LINEIN (Line Input) Function
To read a line from a stream into a REXX program, use the
LINEIN function. The format is:
where:
- name
- is name of the data stream (such as a file) from which the line is read.
- line
- the read position of the string.
- count
- the number of lines read from the character input stream.
The first time a program calls LINEIN, it opens the named file
(name) for reading and returns the first line of data. The
second call to LINEIN, reads the second line and returns the second
line of data, and so on until the program ends (or you close the stream
with LINEOUT). In other words, LINEIN keeps track of its place in
the stream with a kind of bookmark
, called the read
pointer. LINEOUT uses a similar marker, the write
pointer. For more information, see Accessing Data within a Stream.
