02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I/O formatting<br />

Edit descriptors<br />

If the file is opened with BLANK='ZERO', nonleading blanks are treated as zeroes. For more<br />

information about the BLANK= specifier, see “OPEN” on page 376. Plus and minus signs,<br />

commas, or any other symbols are not permitted. If a nonbinary digit appears, an error<br />

occurs. The presence of too many digits for the integer variable (or I/O list item) is illegal.<br />

Table 9-7 provides examples of the binary edit descriptor on input.<br />

Table 9-7 B Edit descriptor: input examples<br />

Descriptor Input field (binary) Value stored (binary)<br />

B8 1111 1111<br />

B8 01111 1111<br />

B4 10101 1010<br />

B8 1.1 error: illegal character<br />

Output<br />

Unlike input, list items on output may be of any type, though character values are output only<br />

as the binary equivalent of their ASCII representation (without a length descriptor). If w is<br />

greater than the number of converted binary digits (excluding leading zeroes), the binary<br />

digits are right-justified in the output field.<br />

If w is less than the number of converted binary digits, the field is filled with w asterisks. This<br />

primarily affects the output of negative values. Because negative values are output in twos<br />

complement form, their high-order bits are nonzero and cause the field to be filled with<br />

asterisks when w is less than the number of binary digits in the entire output value.<br />

The field width required to fully represent the binary value of an item is eight times its size in<br />

bytes. For example, an INTEGER*4 item could require a field w of up to 32 characters.<br />

Only 1s and 0s are printed on output.<br />

Table 9-8 provides examples of the binary edit descriptor on output.<br />

Table 9-8 B Edit descriptor: output examples<br />

Descriptor Internal value Output<br />

B5 27 11011<br />

B8 27 bbb11011<br />

B8.6 27 bb011011<br />

Chapter 9 213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!