ITextReader.ReadToEnd

Syntax

ReadToEnd: String;

Description

The ReadToEnd method reads a text file as one character string.

Example

Sub UserProc;
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.ReadToEnd;
    End If;
    Dispose File1;
End Sub UserProc;

After executing the example, the 1.txt file is read into the "s" variable.

See also:

ITextReader