HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9 255
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. If
m
= 0 and the list item is zero, only blanks are output.
Input
The integer edit descriptor causes the interpretation of the next
w
positions of the input
record. The number is converted to match the type of the list item currently using the
descriptor. A plus sign is optional for positive values. A decimal point must not appear in the
field.
Table 9-16 provides examples of the integer edit descriptor on input.
Output
The integer edit descriptor outputs a numeric variable as a right-justified integer value
(truncated, if necessary). The field width,
w
, should be one greater than the expected number
of digits to allow a position for a minus sign for negative values. If
m
is set to 0, a zero value is
output as all blanks.
Table 9-16 I edit descriptor: input examples
Descriptor Input field Value stored
I4
b
1
bb
1
I5
bbbbb
0
I5
bbbbb
1 0
I2 -1 -1
I4 -123 -123
I3
b
12 12
I3 12
b
12
I3 12
b
120
I3 1.1 error: illegal character