Name

SeekEof Function

Syntax

function SeekEof(var F: TextFile = Input): Boolean

Description

SeekEof skips over white space characters and then returns True if the text file is at the end of file or False if there is more text to read. SeekEof is not a real function.

Errors

  • If the file F is not open, SeekEof reports runtime error 103.

  • The file must have been opened by calling Reset. If the file F was opened by calling Rewrite or Append, SeekEof reports runtime error 104.

  • SeekEof is allowed only for text files.

Example

var
  CmdLine: string;
begin
  while not SeekEof do
  begin
    ReadLn(CmdLine);
    DoCommand(CmdLine);
  end;
end;

See Also

Eof Function, IOResult Function, Reset Procedure, SeekEoln Procedure

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.