HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9260
Input
If the value in the input field does not have an exponent, the internal number is equal to the
field value multiplied by 10-k. If the value in the input field has an exponent, the scale factor
has no effect. See Table 9-22 for examples of the scale factor on input.
Output
The scale factor effect on the EN, ES, F, and G (interpreted as F) edit descriptors is that the
externally-represented number equals the internally-represented number multiplied by
10**k.
The value specified for the scale factor (
k
) must be in the range:
-
d
<
k
< (
d
+ 2)
where:
d
is the number of digits in the fractional part of the number being written.
k
is a signed integer that specifies the scale factor.
Table 9-22 provides examples of the scale factor on output.
When part or all of a format specification is repeated, the current scale factor is not changed
until another scale factor is encountered.
Q (bytes remaining) edit descriptor
The Q edit descriptor is an HP extension that returns the number of bytes remaining to be
read in the input record, placing the result into the corresponding integer variable in the I/O
list. The return value can be used to control the remaining input items.
Table 9-22 P edit descriptor: input and output examples
Format
specification
Input
field
Internal value Output
(-2PG15.5) 1.97E-4
1.97 x 10
-4
bbbbb
.00197E-01
(2P, F15.5) 27.982 .2798199
bbbbbbb
27.98200
(2P,ES15.5) 3518. 35.18
bbbb
3.51800E+01
(-2P,EN15.5) 7.91E+5
7.91 x 10
5
bb
791.00000E+03
(-2PE15.5) .17694 17.694
bbbbb
.00177E+04