READ - read input from file.

Usage:

var
    f : file of TYPE;
    v : TYPE;
  ...
read(f,v);

Where:

f
is a file variable that has been opened for reading using "reset", "openf", or some other means. If this argument is omitted, the default input unit "input" is assumed.
v
is a variable whose type matches the type of the elements in the file "f".

Description:

The "read" procedure reads a single element from the file "f" and stores the value of that element in the variable "v". It is equivalent to

v := f^;
get(f);

A call of the form

read(f,v1,v2,v3,...,vN);

is equivalent to

read(f,v1);
read(f,v2);
   ...
read(f,vN);

Special processing is available if "f" is declared with the type "text". In this case, the variable "v" may have several different types.

See Also:

expl pascal lib readln

expl pascal lib get

Copyright © 1996, Thinkage Ltd.