◄Summary► ◄Details► ◄Example► ◄Back► Argument file_variable Open typed or untyped file Returns LongInt Current file position Description The FilePos function returns the current position in an open nontext file. Numbering of positions in a file begins at 0 and continues through the positive integers. If the current position is at end-of-file, FilePos returns a value equal to the return value of FileSize. The next file operation is performed at the position returned by FilePos. FilePos applies to open typed or untyped files. It does not accept a text file variable. To use FilePos on a text file, declare file_variable as FILE OF Char and assign it to the text file. If file_variable is not associated with a file or if the file is not open when FilePos is called, an I/O error occurs. To prevent a program from halting with a run-time error when an I/O error occurs, turn off I/O checking with {$I-} and check the return value of the IOResult function.