System.Eof

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Eof([var F: File]): Boolean; overload;
function Eof([var F: File]): Boolean; overload;

Properties

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

Description

Tests whether the file position is at the end of a file.

In Delphi code, Eof tests whether the current file position is the end-of-file. F is a file variable that has been opened for reading. If F is omitted, the standard file variable Input is assumed.

Eof(F) returns True if the current file position is beyond the last character of the file or if the file is empty; otherwise, Eof(F) returns False.

Note: Eof fails if the file F has been opened in write-only mode. For example, you cannot use Eof with files opened using the Append or Rewrite, that open files in write-only mode.

See Also


Code Examples