FORTRAN Reference Manual
Introduction to File I/O in the HP NonStop
Environment
FORTRAN Reference Manual—528615-001
5-28
Unformatted I/O
You can use a WRITE statement to write the elements of more than one array. The
following WRITE statement writes the 100 elements in each of the three arrays A, B,
and C:
INTEGER a(10, 10), b(10, 10), c(10, 10)
WRITE(9,10) ((a(i,j), b(i,j), c(i,j), i = 1,10), j=1,10)
Unformatted I/O
If a data transfer statement does not contain a format specifier in its control list, it is an
unformatted I/O statement. Unformatted READ and WRITE statements transfer data as
is between memory and an external device. Each statement transfers exactly one
record.
Formatted I/O
Formatted I/O is either list-directed or edit-directed:
•
If the format specifier of a data transfer statement is an asterisk (*), the statement
is a list-directed I/O statement.
•
If the control list of a data transfer statement contains a format specifier (other than
an asterisk), the statement is an edit-directed I/O statement.
•
The first character of an edit-directed output record controls the vertical spacing for
an output device (by default, a terminal, a printer, or a process).
You can use the SPACECONTROL specifier in the OPEN statement to cause
FORTRAN to treat the first character of such a record as a datum. For additional
information, see OPEN Statement on page 7-70.
This subsection describes only list-directed I/O. Edit-directed I/O is described in
Section 7, Statements.
List-Directed I/O
FORTRAN uses the format of the data it reads to determine the type of input data, and
formats output data according to the values contained in the variables it writes.
You must specify at least one of END= or IOSTAT= if you want your program to
continue running if an end of file is encountered.
Character Vertical Spacing Before Printing
Blank One line
0 Two lines
1 To first line of next page
+ No advance










