FSEEK( ) Function

Example   See Also

Moves the file pointer in a file opened with a low-level file function.

Syntax

FSEEK(nFileHandle, nBytesMoved [, nRelativePosition])

Returns

Numeric

Arguments

nFileHandle

Specifies the file handle for the file in which FSEEK( ) moves the file pointer. A file handle number is returned by FCREATE( ) or FOPEN( ) when the file is created or opened.

nBytesMoved

Specifies the number of bytes to move the file pointer. The file pointer is moved toward the end of the file if nBytesMoved is positive. The file pointer is moved toward the beginning of the file if nBytesMoved is negative.

nRelativePosition

Moves the file pointer to a relative position in the file. By default, the file pointer is moved relative to the beginning of the file. You can also move the file pointer relative to the current file pointer or the end of the file by including nRelativePosition. The following table lists values for nRelativePosition and from where the file pointer is moved.

nRelativePosition Moves the file pointer relative to
0 (Default) The beginning of the file.
1 The current file pointer position.
2 The end of the file.

Remarks

After moving the file pointer, FSEEK( ) returns the number of bytes the file pointer is positioned from the beginning of the file. The file pointer can also be moved with FREAD( ) and FWRITE( ).