HP Fortran Programmer's Reference (September 2007)

I/O and file handling
File access methods
Chapter 8210
List-directed I/O
List-directed I/O is similar to formatted I/O in that data undergoes a format conversion when
it is transferred but without the use of a format specification to control formatting. Instead,
data is formatted according to its data type. List-directed I/O is typically used when reading
from standard input and writing to standard output.
List-directed I/O uses the asterisk (*) as a format identifier instead of a list of edit descriptors,
as in the following READ statement, which reads three floating-point values from standard
input:
READ *, A, B, C
List-directed I/O can be performed only on internal files and on formatted, sequential external
files. It works identically for both file types.
Input Input data for list-directed input consists of values separated by one or more blanks, a
slash, or a comma preceded or followed by any number of blanks. (No values may follow the
slash.) An end-of-record also acts as a separator except within a character constant. Leading
blanks in the first record read are not considered to be part of a value separator unless
followed by a slash or comma.
Input values can be any of the values listed in Table 8-1. A blank is indicated by the symbol b.
Reading always starts at the beginning of a new record. Records are read until the list is
satisfied, unless a slash in the input record is encountered. The effect of the slash is to
terminate the READ statement after the assignment of the previous value; any remaining data
in the current record is ignored.
Table 8-1 Input values for list-directed I/O
Value Meaning
z
A null value, indicated by two successive separators with
zero or more intervening blanks (for example, ,
b
/).
c
A literal constant with no embedded blanks. It must be
readable by an I, F, A, or L edit descriptor. Binary, octal, and
hexadecimal data are illegal.
r*c
Equivalent to
r
(an integer) successive occurrences of
c
in the
input record. For example, 5*0.0 is equivalent to 0.0 0.0
0.0 0.0 0.0.
r*z
Equivalent to
r
successive occurrences of
z
.