HP Fortran Programmer's Reference (September 2007)

I/O formatting
FORMAT statement
Chapter 9 237
FORMAT statement
The function of the FORMAT statement is to specify formatting information that can be used by
one or more of the following data transfer statements:
ACCEPT (extension)
DECODE (extension)
ENCODE (extension)
PRINT
READ
TYPE (extension)
WRITE
The syntax of the FORMAT statement is:
label
FORMAT (
format-spec
)
where:
label
is a statement label.
format-spec
is a format specification consisting of a comma-separated list of edit
descriptors. For detailed information about edit descriptors, see the next
section.
The FORMAT statement must include
label
so that the data transfer statements can reference
it. One FORMAT statement can be referenced by many data transfer statements. In the
following example, both the READ and WRITE statements reference the same FORMAT
statement:
READ(UNIT=22, FMT=10)ivar, fvar
WRITE(17, 10)ivar, fvar
...
10 FORMAT(I7, F14.3)
For additional information about the FORMAT statement and data transfer statements, see
Chapter 10, “HP Fortran statements,” on page 267.