HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9262
[
r
]Z[
w
[
.m
]]
where:
r
is a positive integer constant, specifying the repeat factor.
w
is a positive integer constant, specifying the field width.
m
is a nonnegative integer constant, specifying the minimum number of digits
that must be in the field and forcing leading zeroes as necessary up to the
first nonzero digit. The
m
value is ignored on input. If
m
is not specified, a
default value of 1 is assumed. If
m
is larger than
w
, the field is filled with
w
asterisks.
Input
Variables to receive hexadecimal input must be of type integer. Legal hexadecimal digits are 0
through 9, and A through F (or a through f). Nonleading blanks are ignored, unless the file is
opened with BLANK='ZERO'. If the file is opened with BLANK='ZERO', nonleading blanks are
treated as zeroes. For more information about the BLANK= specifier see “OPEN” on page 410.
Plus and minus signs, commas, or any other symbols are neither permitted on input nor
printed on output. The presence of too many digits for the integer variable (or list item)
produces undefined results.
Table 9-23 provides examples of the hexadecimal edit descriptor on input.
Output
List items may be of any type, though character variables are output only as the hexadecimal
equivalent of their ASCII representation (without a length descriptor). If
w
is greater than the
number of converted hexadecimal digits (excluding leading zeroes), the hexadecimal digits are
right-justified in the output field. If
w
is less than the number of converted hexadecimal digits,
the field is filled with asterisks. This primarily affects the output of negative values. Because
Table 9-23 Z edit descriptor: input examples
Descriptor
Input field
(hexadecimal)
Value stored
(hexadecimal)
Z4 FF3B FF3B
Z4 fFfF FFFF
Z2 ABCD AB
Z3 1.1 error: illegal character