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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Language</strong> <strong>Reference</strong><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<br />

the list of specifiers.<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 />

5. Any character expression except one involving the concatenation of an operand<br />

whose length specification is (*) unless the operand is a symbolic constant (see<br />

the PARAMETER statement).<br />

6. An asterisk (*), indicating list-directed formatting.<br />

<strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> supports a third form of the READ statement in<br />

which the asterisk (*) may be omitted. This is a form of list-directed<br />

formatting in which unit 5 is assumed. It is equivalent to<br />

READ * [,ilist]<br />

7. A NAMELIST name, indicating namelist-directed formatting.<br />

If the optional FMT= specifier is omitted then the format specifier must be the second item<br />

in the list of specifiers and UNIT= must not be specified for the first item in the list.<br />

REC = rn<br />

IOSTAT = ios<br />

ERR = s<br />

END = s<br />

rn is an integer expression whose value must be positive. It is the number of the record to<br />

be read when a file is connected for direct access.<br />

is an input/output status specifier. The integer variable or integer array element ios is<br />

defined with zero if no error occurs, a positive integer value if an error occurs, or a negative<br />

integer value if an end-of-file occurs.<br />

is an error specifier and s is a statement label. When an error occurs, execution is<br />

transferred to the statement labelled by s.<br />

is an end-of-file specifier and s is a statement label. When an end-of-file occurs, execution<br />

is transferred to the statement labelled by s.<br />

Input list - An input list may contain one or more of the following:<br />

1. A variable name.<br />

2. An array element name.<br />

124 READ Statement

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

Saved successfully!

Ooh no, something went wrong!