ITextReader.ReadWord

Syntax

ReadWord: String;

Description

The ReadWord method reads words taking into account a separator set by the ITextReader.WordDelimiters property.

Example

Sub Main;

Var

File1: IFileInfo;

TextR: ITextReader;

s: String;

Begin

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

If File1.Exists Then

TextR:=File1.OpenTextReader;

s:=TextR.ReadWord;

End If;

Dispose File1;

End Sub Main;

After executing the example the "s" variable contains the first word read from the 1.txt file.

See also:

ITextReader