HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9 261
The Q edit descriptor is valid on input only; it is ignored on output. It can be used for reading
formatted, sequential, and direct-access files. The following program segment reads
variable-length strings from a sequential file:
CHARACTER(LEN=80) :: string
INTEGER :: n, i
...
READ (11,'(Q,80A1)') n, (string (i:i), i=1, n)
For information about the Q
w.d
edit descriptor for editing real data, see “D, E, EN, ES, F, G,
and Q (real) edit descriptors” on page 249.
S, SP, and SS (plus sign) edit descriptors
The S, SP, and SS edit descriptors control printing of the plus sign character in numeric
output. The default behavior of HP Fortran is not to print the plus sign. However, an SP edit
descriptor in the format specification causes the plus sign to appear in any subsequent
numeric output where the value is positive. The SS descriptor suppresses the plus sign in
subsequent numeric output. The S edit descriptor restores the default behavior.
The sign edit descriptors have no effect on input.
T, TL, TR, and X (tab) edit descriptors
The tab edit descriptors position the cursor on the input or output record. Their syntax is:
T
n
TL
n
TR
n
n
X
where:
n
is a positive integer constant, specifying the number of column positions to
skip for positioning within the current output or input record.
The T edit descriptor references an absolute column number, while the descriptors TL and TR
reference a relative number of column positions to the left (TL) or right (TR) of the current
cursor position. Note that the TR descriptor is identical to the X edit descriptor.
Z (hexadecimal) edit descriptor
The Z edit descriptor defines a field for hexadecimal data. This descriptor provides for
conversion between an external hexadecimal number and its internal representation.
The syntax for the hexadecimal edit descriptor is: