Moves the pointer to the specified position in an OLEStream object or in a file that you open using the FileDirect object.
To move the pointer in |
Use |
---|---|
an OLEStream object |
|
a file opened by the FileDirect object |
Moves the read/write pointer to the specified position in an OLE stream object. The pointer is the position in the stream at which the next read or write begins.
OLEStream objects
olestream.Seek ( position {, origin } )
Integer. Returns 0 if it succeeds and a negative number if an error occurs.
Moves the pointer in a file that you open with the FileDirect object.
FileDirect objects
instancename.Seek (distanceToMove, mode)
Argument |
Description |
---|---|
instancename |
Instance name of the FileDirect object |
distanceToMove |
Long for the number of bytes by which you want to move the file pointer. You move the pointer from the position specified by the mode argument |
mode |
Enumerated value of type seektype. Values can be:
|
Integer. Returns 1 for success and a negative number for an error.
Use the Seek function to place the file pointer at a specified position before you begin to read from or write to the file.
The following script moves the file pointer 100 bytes from the file end before the Read function is called:
li_ret = nvo_FileDirect.seek ( 100, fromend!) li_ret = nvo_FileDirect.read ( lb_data, 100, li_amount)