ITextReader.ReadInteger

Syntax

ReadInteger: Integer;

Description

The ReadInteger method reads an integer value from a text file.

Example

Sub Main;

Var

File1: IFileInfo;

TextR: ITextReader;

i: Integer;

Begin

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

If File1.Exists Then

TextR:=File1.OpenTextReader;

i:=TextR.ReadInteger;

End If;

Dispose File1;

End Sub Main;

After executing the example the "i" variable contains an integer value read from the 1.txt file.

See also:

ITextReader