HP Fortran Programmer's Reference (September 2007)

I/O formatting
Edit descriptors
Chapter 9246
Table 9-6 provides examples of character edit descriptors on output. In the table,
b
represents
a blank and
z
represents a Null.
B (binary) edit descriptor
The B edit descriptor defines a field for binary data. It provides for conversion between an
external binary number and its internal representation.
The syntax for the binary edit descriptor is:
[
r
]B[
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 an unsigned 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 binary input must be of type integer. The only legal characters are 0s and
1s. Nonleading blanks are ignored, unless the file is opened with BLANK='ZERO'.
Table 9-6 A and R Edit descriptors: output examples
Descriptor
Internal
characters
Variable
length
Output
A6 ABCDEF 6 ABCDEF
R4 ABCDEFGH 8 EFGH
A4 ABCDE 5 ABCD
A8 STATUS 6
bb
STATUS
R8 STATUS 6
bb
STATUS
R8 STATUS 8 STATUS
bb