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 />

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 />

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 in the list of<br />

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

10.6.3 Record Specifier<br />

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

REC = rn<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 />

10.6.4 Input/Output Status Specifier<br />

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

IOSTAT = ios ios is an integer variable or integer array element. It is defined with zero if no error<br />

occurs, a positive integer value if an error occurs, or a negative integer value if an<br />

end-of-file occurs.<br />

If an input/output error or end-of-file condition occurs during the execution of an input/output statement<br />

and the input/output status specifier is present then execution of the program is not terminated.<br />

Input/output errors may result from a violation of the rules of <strong>FORTRAN</strong> or from a file system error. For<br />

example, a negative unit number will result in an error since this is a violation of the rules of <strong>FORTRAN</strong>.<br />

An example of a file system error might be an attempt to create a file on a non-existent file storage device.<br />

Consult the User’s Guide for a list of <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> diagnostic messages. An input/output<br />

status of nn corresponds to the message IO-nn. For example, if the status returned is 3 then the error is:<br />

IO-03 ENDFILE statement requires sequential access mode<br />

10.6.5 Error Specifier<br />

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

ERR = s<br />

s is a statement label. When an error occurs, execution is transferred to the statement<br />

labelled by s.<br />

If an input/output error occurs during the execution of an input/output statement and the ERR= specifier is<br />

present then execution of the program is not terminated.<br />

222 Specifiers

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

Saved successfully!

Ooh no, something went wrong!