HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9 259
form, their high-order bits are nonzero and cause the field to be filled with asterisks when
w
is
less than the number of octal digits in the entire output value. If
m
is set to 0, a zero value is
output as all blanks.
Table 9-21 provides examples of the octal edit descriptors on output.
P (scale factor) edit descriptor
The
k
P edit descriptor causes a scale factor of
k
to be applied to all subsequent F, D, E, EN, ES,
and G edit descriptors in the format specification.
If the P edit descriptor does not precede an F, D, E, EN, ES, or G edit descriptor, it should be
separated from other edit descriptors by a comma. If the P edit descriptor immediately
precedes an F, D, E, EN, ES, or G edit descriptor, the comma is optional.
For example, the format specification
(3P, I2, F4.1, E5.2)
is equivalent to
(I2, 3PF4.1, E5.2)
When a format specification is interpreted, the scale factor is initially set to 0. When a P edit
descriptor is encountered, the specified scale factor takes effect for the format specification
and remains in effect until another P edit descriptor is encountered.
The effect of the scale factor differs for input and output as follows:
Table 9-21 O edit descriptor: output examples
Descriptor Internal value Output (Octal)
O6 80
bbb
120
O2 80 **
O14 -9
bbb
37777777767
O11 32767
bbbbbb
77777
O6.4 79
bb
0117
O12 1.1
bb
7743146315
O12 'A'
b
101
O12 'ABC'
b
101
b
102
b
103