25.115. LOC()

[<<<] [>>>]

Return current file pointer position of the opened file. The argument of the function is the file number that was used by the statement OPEN opening the file.

This function is the counter part of the statement SEEK that sets the file pointer position.

The file position is counted in record size. This means that the file pointer stands after the record returned by the function. This is not necessarily stands right after the record at the start of the next record actually. It may happen that the file pointer stands somewhere in the middle of the next record. Therefore the command

SEEK fn,LOC(fn)

may alter the actual file position and can be used to set the file pointer to a safe record boundary position.

If there was no record size defined when the file was opened the location is counted in bytes. In this case the returned value precisely defines where the file pointer is.

[<<<] [>>>]