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.

<strong>Language</strong> <strong>Reference</strong><br />

Example:<br />

REAL X<br />

X = 234.43<br />

PRINT ’(F10.2)’, X<br />

END<br />

When using a character expression to represent a format specification, the format specification can be<br />

preceded by blank characters and followed by any character data without affecting the format specification.<br />

The following example produces the identical result to the previous example.<br />

Example:<br />

REAL X<br />

X = 234.43<br />

PRINT ’<br />

END<br />

(F10.2) THIS IS FOR X’, X<br />

If a character array is used to describe the format specification, the format specification is considered to be<br />

the concatenation of all the character array elements in the order given by array element ordering described<br />

in the chapter entitled "Arrays" on page 159. Note that if a character array element is used, the format<br />

specification is considered to be only that array element.<br />

Example:<br />

REAL X<br />

CHARACTER*5 FMTSPEC(3)<br />

X = 234.43<br />

FMTSPEC(1)=’(’<br />

FMTSPEC(2)=’F10.2’<br />

FMTSPEC(3)=’)’<br />

PRINT FMTSPEC, X<br />

END<br />

11.4 Format Specification<br />

A format specification has the following form.<br />

<br />

( [flist] )<br />

where:<br />

flist<br />

is a list whose items are separated by commas. The forms of the items in flist are:<br />

[r] ed<br />

ned<br />

[r] fs<br />

ed<br />

ned<br />

is a repeatable edit descriptor.<br />

is a nonrepeatable edit descriptor.<br />

226 Format Specification

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

Saved successfully!

Ooh no, something went wrong!