ITextReader.Eof

Syntax

Eof: Boolean;

Description

The Eof property returns a flag of the end of a file.

Example

Sub Main;

Var

File1: IFileInfo;

TextR: ITextReader;

Word: IStringList;

Begin

File1:=New FileInfo.Attach("c:\New_folder\1.txt");

Word:=New StringList.Create;

If File1.Exists Then

TextR:=File1.OpenTextReader;

While Not TextR.Eof Do

Word.Add(TextR.ReadWord);

End While;

End If;

Dispose File1;

End Sub Main;

After executing this example, an array of words read from 1.txt file is located in a variable Word. A space is used as a separator between words.

See also:

ITextReader