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>FORTRAN</strong> Statements<br />

2.12 CLOSE Statement<br />

<br />

CLOSE (cllist)<br />

where:<br />

cllist<br />

is a list of close specifiers separated by commas:<br />

[UNIT =] u<br />

IOSTAT = ios<br />

ERR = s<br />

STATUS = sta<br />

A CLOSE statement is used to terminate the connection of a file to the specified unit.<br />

Close Specifiers<br />

[UNIT =] u<br />

IOSTAT = ios<br />

ERR = s<br />

u is an external unit identifier. An external unit identifier is a non-negative integer<br />

expression. If the optional UNIT= specifier is omitted then the specifier must be the first<br />

item in the list of specifiers.<br />

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

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

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

STATUS = sta<br />

is a status specifier and sta is a character expression whose value when trailing blanks are<br />

removed evaluates to one of ’KEEP’ or ’DELETE’.<br />

KEEP<br />

DELETE<br />

’KEEP’ may not be specified for a file whose status is ’SCRATCH’ (see<br />

description of the OPEN statement). If the file exists, it will exist after<br />

execution of the CLOSE statement. If the file does not exist, it will not<br />

exist after execution of the CLOSE statement. If not specified, ’KEEP’ is<br />

assumed, unless the file status is ’SCRATCH’ in which case ’DELETE’ is<br />

assumed.<br />

If ’DELETE’ is specified, the file will not exist after execution of the<br />

CLOSE statement.<br />

CLOSE Statement 29

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

Saved successfully!

Ooh no, something went wrong!