@FILESEEKL[n,line[,1]] : Moves the file pointer to the specified line in the open file whose handle is n. The first line in the file is numbered 0. Returns the new position of the pointer, in bytes from the start of the file. The third parameter is optional, and determines the starting point for the seek. If not specified, or set to a value other than 1,  @FILESEEKL starts at the beginning of the file. If set to 1, @FILESEEKL will start from the current position in the file.

 

If the function fails, the return value is -1.

 

@FILESEEKL must read each line of the file up to the target line in order to position the pointer, and can therefore cause significant delays if used in a loop or on a large file.

 

Numeric input may be entered in either decimal format (a sequence of 0-9 digits) or in hexadecimal format ("0x" followed by a sequence of 0-F hex digits).

 

This function should only be used with file handles returned by @FILEOPEN. If you use it with any other number you may damage other files opened by TCC-RT (or by the program which started TCC-RT).

 

Example:

 

set h=%@fileopen["d:\path\myfile.txt",rw]

echo file line 10 = %@fileseekl[%h,10,2]

echo closing handle #%h: %@fileclose[%h]

 

See also the related handle-based functions:

 

@FILECLOSEClose a file handle
@FILEOPENOpen a file handle
@FILEREADRead next line from a file handle
@FILESEEKMove a file handle pointer
@FILEWRITEWrite next line to a file handle
@FILEWRITEBWrite data to a file handle
@TRUNCATETruncate the file at the current position of the file handle pointer.