From RAD Studio API Documentation
Jump to: navigation, search


procedure Seek(var F: File; N: Integer);


Type Visibility Source Unit Parent
procedure public System.pas System System


Moves the current position of a file to a specified component.

Use Seek in Delphi code to move to a specified position in open typed or untyped files. The current file position of F moves to component number N, where the number of the first component of a file is 0.

In the above syntax, F is a typed or untyped file variable. The file specified by F must be open. N is an expression of type Cardinal.

To expand a file, seek one component beyond the last component; that is, the statement Seek(F, FileSize(F)) moves the current file position to the end of the file.

Note: {$I+} handles run-time errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.

See Also

Code Examples