IFile.OpenTextReader

Syntax

OpenTextReader(FileName: String): ITextReader;

Parameters

FileName — path and name of the file that must be opened.

Description

The OpenTextReader method opens a file for reading in a text format.

Example

Sub Main;

Var

TextR: ITextReader;

d: DateTime;

Begin

If File.Exists("c:\New_folder\1.txt") Then

TextR:=File.OpenTextReader("c:\New_folder\1.txt");

d:=TextR.ReadDateTime;

End If;

End Sub Main;

After executing the example, date and time are obtained into the "d" variable from the 1.txt file.

See also:

IFile