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

Example:<br />

LOOP<br />

READ( UNIT=8, END=100, FMT=200 ) RECORD<br />

ENDLOOP<br />

100 CLOSE( UNIT=8 )<br />

In the previous example, we illustrate how one might process the records in a file and then terminate the<br />

connection of the file to unit 8 using the CLOSE statement.<br />

Notes:<br />

1. Execution of a CLOSE statement specifying a unit that is not connected to a file or a unit that is<br />

connected to a file that does not exist has no effect.<br />

2. It is possible to connect the unit to another file after a CLOSE statement has been executed.<br />

3. It is possible to connect the unit to the same file after a CLOSE statement has been executed,<br />

provided that the file still exists.<br />

4. It is possible to connect the file to another unit after a CLOSE statement has been executed,<br />

provided that the file still exists.<br />

5. At the termination of execution of the program, for whatever the reason of termination, any units<br />

that are connected are closed. Each unit is closed with status ’KEEP’ unless the file status was<br />

’SCRATCH’, in which case the unit is closed with status ’DELETE’. The effect is the same<br />

as if a CLOSE statement is executed without a STATUS= specifier.<br />

For more information on input/output, see the chapter entitled "Input/Output" on page 215.<br />

30 CLOSE Statement

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

Saved successfully!

Ooh no, something went wrong!