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.

Input/Output<br />

10.6 Specifiers<br />

All input/output statements contain one or more specifiers. They appear in a list separated by commas.<br />

Some of the more common specifiers are those listed below. Not all of them need be used in every<br />

input/output statement. You should consult the description of the input/output statement under<br />

consideration to discover which specifiers are allowed and what they mean.<br />

[UNIT =] u<br />

[FMT =] f<br />

REC = rn<br />

IOSTAT = ios<br />

ERR = s<br />

END = s<br />

the unit specifier<br />

the format specifier<br />

the record specifier<br />

the input/output status specifier<br />

the error specifier<br />

the end-of-file specifier<br />

We shall look at these specifiers in more detail.<br />

10.6.1 The Unit Specifier<br />

The form of a unit specifier in an input/output statement is:<br />

[UNIT =] u<br />

u is an external unit identifier or an internal file identifier.<br />

1. An external unit identifier is a non-negative integer expression or an asterisk<br />

(*) in which case unit 5 is assumed for an input statement and unit 6 is assumed<br />

for an output statement. The unit identifier must not be an asterisk for the<br />

BACKSPACE, ENDFILE and REWIND statements.<br />

2. An internal file identifier is the name of a character variable, character array,<br />

character array element, or character substring.<br />

If the optional UNIT= specifier is omitted then the unit specifier must be the first item in the list of<br />

specifiers.<br />

10.6.2 Format Specifier<br />

The form of a format specifier in an input/output statement is:<br />

[FMT =] f<br />

f is a format identifier. A format identifier is one of the following:<br />

1. A statement label of a FORMAT statement that appears in the same program unit<br />

as the format identifier.<br />

2. An integer variable name that has been assigned the statement label of a<br />

FORMAT statement that appears in the same program unit as the format identifier<br />

(see the ASSIGN statement).<br />

3. An integer array name.<br />

4. A character array name.<br />

Specifiers 221

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

Saved successfully!

Ooh no, something went wrong!