HP Pascal/iX Reference Manual (31502-90022)

3- 16
File_type:
Example
TYPE
person = RECORD
name: PACKED ARRAY [1..30] OF char;
age: 1..100;
END;
person_file = FILE OF person;
bit_vector = PACKED ARRAY [1..100] OF Boolean;
vector_file = FILE OF bit_vector;
data_file = FILE OF integer;
doc_file = text;
Standard Textfiles
text
Text type variables are called
textfiles
. The standard file type
text
permits ordinary input and output that is oriented to characters and
lines. Text type files have two important features:
* The components are type
char
.
* The file is subdivided into lines by special
end-of-line markers
.
Textfiles cannot be opened for direct access with the procedure
open
.
Textfiles can be sequentially accessed, however, with the procedures
reset, rewrite,
or
append
. All standard procedures that are legal for
sequentially-accessed files are also legal for textfiles.
Certain standard procedures and functions, on the other hand, are only
legal for textfiles. These procedures are:
* eoln
* linepos
* overprint
* page
* prompt
* readln
* writeln
Textfiles permit conversion from the internal form of certain types to an
ASCII character representation and vice versa.
Example
VAR
myfile: text;
i: integer;
r: real;