HP Pascal/iX Reference Manual (31502-90022)

10- 15
For example, the call
read(f,v1,...,vn);
establishes a reference, ff, to the file variable,
f
. It is equivalent
to:
read(ff,v1);
read(ff,v2);
.
.
.
read(ff,vn);
Example
read(file_var,variable)
read(file,variable1,...,variablen)
read(variable)
read(variable1,...,variablen)
Illustration
Suppose examp_file is a file of char opened in the input state. The
current position is at the second component. To read the value of this
component into char_var, we call read:
Implicit Data Conversion.
If
f
is a textfile, its components are type char. The parameter,
v
,
however, need not be of type char. It may be any simple, string, or PAC
type, which is an HP extension. The read procedure performs an implicit
conversion from the ASCII form that appears in the textfile
f
to actual
form stored in the variable
v
.
If
v
is type real, longreal, integer, or an integer subrange, the
read(
f,v
) operation searches
f
for a sequence of characters which
satisfies the syntax below for these types. The search skips preceding
blanks or end-of-line markers. If
v
is longreal, the result is
independent of the letter preceding the scale factor.
It is an error if the read operation finds no non-blank characters or a