[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Seek                     Moves to a Specific Record in a Data File

 Seek(var DFile : file of <type>; ItemNum : Integer);                    [TP]
 Seek(var UFile : file; RecNum : Integer);                               [TP]

    Moves the file pointer to the indicated record of the file accessed by
    the file variable DFile or UFile. Following this call, a Read (or
    BlockRead) will read in that record, while a Write (or BlockWrite)
    will write out to that record. The first record number in a file is 0;
    Seek(F,0) therefore moves to the first record in the file.

           DFile    A data file.

          <type>    Any type except a file type.

           UFile    An untyped file.

           Note:    See LongSeek for a function that will move the file
                    pointer for files that have more than (MAXINT + 1)
                    records. (MAXINT = 32767).

  -------------------------------- Example ---------------------------------

           I := 20;
           Seek(DFile,I);           { move to record 20 }
           Seek(DFile,30);          { move to record 30 }

See Also: LongSeek FilePos FileSize BlockRead BlockWrite
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson