ITextReader.ReadLine

Syntax

ReadLine: String;

Description

The ReadLine method reads a characters string from a text file.

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.ReadLine;

End If;

Dispose File1;

End Sub Main;

After executing this example, the first character string read from the text file 1.txt is contained in the "s" variable.

See also:

ITextReader