Contents | Prev | Next

5.15.18 text type

Description

text is the type identifier for a built-in file type, whose values are sequences of lines. A line is a sequence of characters and every line in a text file is terminated by an end-of-line character except possibly the last line (see Termination of all lines in text files).

Example

The simple program below writes a short message to a text file.

program message(fOut);
const
 OutputFileName='message.txt';
var
 fOut : text;
begin
 rewrite(fOut, OutputFileName);
 writeln(fOut, 'This file is generated by a very simple program');
 writeln(fOut, 'which was written to help explain the "text" file type.');
 close(fOut);
end.

Portability

Operating Systems: All
Standard Pascal: Yes

Contents | Prev | Next