Name
Seek -- set file cursor to a new position
Synopsis
Seek(id, newpos[, mode])
Function
This function sets the file cursor (from which all read/write operations start) to newpos. The beginning of the file is at position 0. If you want to seek to the end-of-file, set newpos to the special constant #EOF.

To find out the cursor position of a specific file, you can use the FilePos() command.

Starting with Hollywood 6.0 you can use the optional mode argument to set the seek mode which should be used. This can be one of the following mode constants:

#SEEK_BEGINNING:
The specified seeking position is relative to the beginning of the file. Negative positions are not allowed. This is the default seek mode.

#SEEK_CURRENT:
The specified seeking position is relative to the current position of the file cursor. You may also pass negative positions here to seek backwards from the current file cursor position.

#SEEK_END:
The specified seeking position is relative to the file's ending. You may only pass 0 or negative positions here. To seek to the end of the file, simply pass 0.

Inputs
id
number specifying the file to use
newpos
position to set the file cursor to
mode
optional: seek mode to use (defaults to #SEEK_BEGINNING) (V6.0)
Example
See ReadChr


Show TOC