Equinox Online Help - Language Reference - A to Z
FileMovePosition |
|
---|---|
Applies to | |
Syntax | FileMovePosition HandleItem, WhereExpression |
Action | [Statement] Moves the current read/write position in a random or sequential file. |
Scope | Usable anywhere |
Notes | The File I/O system automatically maintains a pointer to a position within a file. eg If you read ten characters from a file, the file pointer for that particular file will then be positioned at the eleventh character. Using the FileMovePosition statement, you can reposition the pointer to anywhere in the file. The HandleItem parameter must be an Equinox variable type Handle and is the handle of the file which was opened with the FileOpen statement. The WhereExpression parameter indicates the position in the file, starting from 1, where the pointer will be located:
The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero. |
Category | File IO |
See Also | FileClose, FileCloseAll, FileDelimiters, FileInput, FileInputLine, FileLock, FileMovePosition, FileOpen, FilePosition, FilePrint, FileRead, FileReadLine, FileReadBinary, FileReadFile, FileUnlock, FileWrite, FileWriteBinary, FileWriteFile |
Example | The first example goes to the end of a random file which is already open and appends a string. FileMovePosition hTest, -1 This next example opens a sequential file, writes some records and then writes the number of records at the beginning of the file. handle hTest |