24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language 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.

Format<br />

If w is specified in A output editing so that w is greater than len, then the output field will consist of<br />

w-len blanks followed by the len characters of the I/O list item. If w is less than or equal to len, the<br />

output field will consist of the first w characters of the I/O list item.<br />

Example:<br />

PRINT ’(1H)’,’ABCDEFG’,’123’<br />

The output produced by the PRINT statement in the previous example is the string:<br />

<br />

11.7.13 Z Editing (Extension)<br />

The Zw edit descriptor is used to display the hexadecimal representation of data or read hexadecimal data.<br />

It is a <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> extension. The Zw edit descriptor can be used for I/O list items of any<br />

type. The field width is w.<br />

On output, w must be greater than or equal to twice the size (in bytes) of the I/O list item since each byte is<br />

represented by two hexadecimal digits. For example, real data requires four bytes. Hence, w must be at<br />

least eight.<br />

Example:<br />

PRINT ’(1H)’, 256<br />

The output produced by the PRINT statement in the previous example is the string:<br />

<br />

If w is greater then the number of hexadecimal digits required to represent the data, the leftmost print<br />

positions of the output field are filled with blanks.<br />

Example:<br />

PRINT ’(1H)’,’ABCD’<br />

The output produced by the PRINT statement in the previous example is the string<br />

< C1C2C3C4><br />

if the EBCDIC character set is being used or<br />

< 41424344><br />

if the ASCII character set is being used.<br />

On input, if w is greater than twice the size (in bytes) of the I/O list item, the leftmost characters are<br />

truncated from the input field. For example, if the input field contains the string<br />

91A2C3D4<br />

and is read into a character variable whose length is two, the character would contain the hexadecimal data<br />

C3D4. If w is less than twice the size (in bytes) of the I/O item, the I/O item is padded to the left with<br />

hexadecimal zeroes. For example, if the input field contains the string<br />

81C1<br />

Editing 237

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

Saved successfully!

Ooh no, something went wrong!