Contents  Index  
──────────────────────────────────────────────────────────────────────────────
The SEEK function returns the current file position.
The SEEK statement sets the file position for the next read or write.

SEEK(filenumber%)
SEEK [#]filenumber%, position&filenumber%    The number of an open file.
    ■ position&      The position where the next read or write occurs. For
                     random-access files, a record number. For other files,
                     the byte position relative to the beginning of the file.
                     The first byte is at position 1.

Example:
    OPEN "TEST.DAT" FOR RANDOM AS #1
    FOR i% = 1 TO 10
        PUT #1, , i%
    NEXT i%
    SEEK #1, 2
    GET #1, , i%
    PRINT "Data: "; i%; " Current record: "; LOC(1); " Next: "; SEEK(1)

See Also    GET, PUT    OPEN
──────────────────────────────────────────────────────────────────────────────
 © Copyright Microsoft Corporation, 1987-1992. All rights reserved.
   Converted from qbasic.hlp with DosHelp/HelpConvert