qb45advr.hlp (Topic list)
SEEK Statement Details
  QuickSCREEN      Details      Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
SEEK Statement Details
 
Syntax
  SEEK [#]filenumber,position
 
The filenumber is an integer number used in the OPEN statement to open the
file.
 
The position is a numeric expression indicating where the next read or
write is done. The position must be in the range 1 to 2,147,483,647
(equivalent to 2^31 -1). For files opened in RANDOM mode, position is
the number of a record in the file.
 
For files opened in BINARY, INPUT, OUTPUT, or APPEND modes, position is the
number of a byte from the beginning of the file. The first byte in a file
is 1. After a SEEK, the next file I/O operation starts at that byte in the
file.
 
  Note: Record numbers on a GET or PUT override the file positioning
        done by SEEK.
 
A SEEK to a negative or zero position produces an error message that reads
"Bad record number." Performing a file write after doing a SEEK beyond the
end of a file extends the file.
 
When used on a device that does not support SEEK, BASIC ignores SEEK and
leaves the file position unchanged. The BASIC devices (SCRN:, CONS:, KYBD:,
COMn:, and LPTn:) do not support SEEK.