HP Pascal/iX Reference Manual (31502-90022)

10- 14
read
Usage
read
(f,v)
read
(f, v1, ..., vn)
read
(v)
read
(v1, ..., vn)
Parameters
f
A file variable opened in the input or direct access state. If
f
is
omitted, the system uses the standard file
input
.
v
The name of a variable or component of a structure whose type is not
FILE and does not contain a component of type FILE.
Description
The procedure read
(f, v)
assigns the value of the current component of
f
to the variable
v
, according to the rules below, advances the current
position, and causes any subsequent reference to the buffer variable
f
^
to actually load the buffer with the current component.
If the file is a textfile, the read variables can be simple, string, or
PAC variable. If the file is not a textfile, its components must be
assignment compatible with the variable.
The following statement:
read(f,v)
is equivalent to accessing the file variable and establishing a reference
to that file variable for the remaining execution of the statement
(denoted by ff) and then calling get on ff.
v := ff^
get(ff);