qb45advr.hlp (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
SEEK Function Details
◄QuickSCREEN► ◄Details► ◄Example► ◄Contents► ◄Index►
──────────────────────────────────────────────────────────────────────────────
SEEK Function Details
Syntax
SEEK(filenumber)
The filenumber is the number used in the OPEN statement to open the file.
SEEK returns a value in the range 1 to 2,147,483,647 (equivalent to 2^31 -1).
SEEK returns the number of the next record read or written when used on
RANDOM mode files. For files opened in BINARY, OUTPUT, APPEND, or INPUT
mode, SEEK returns the byte position in the file where the next operation
is to take place. The first byte in a file is 1.
When used on a device that does not support SEEK, the function returns zero.
The BASIC devices (SCRN:, CONS:, KYBD:, COMn:, and LPTn:) do not support
SEEK.
The following code fragment prints a message indicating whether the last
read or write was done in the first, second, or final third of the file:
SELECT CASE (SEEK(1))
CASE IS < .333*LOF(1)
PRINT "In first third of file."
CASE .333*LOF(1) TO .667*LOF(1)
PRINT "In second third of file."
CASE IS >= .667*LOF(1)
PRINT "In last third of file."
CASE ELSE
END SELECT