Jump to navigation Jump to search
Revision as of 07:14, 3 July 2012 by
The SEEK statement sets the next byte or record position of a file for a read or write.
- SEEK filenumber%, position%
- The filenumber must be the file number that is OPEN.
- Position is a byte in BINARY or sequencial files created in OUTPUT, APPEND or INPUT (file mode)s. The first byte = 1.
- Position is the record in RANDOM files to read or write.
- Since the first file position is 1 it may require adding one to an offset value when documentation uses that position as 0.
- After a SEEK statement, the next file operation starts at that SEEK byte position.
- The SEEK statement can work with the SEEK function to move around in a file.
Example: A SEEK statement using the SEEK function to move to the next random record in a file.
SEEK 1, SEEK(1) + 1