06.03.2014 Views

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

File Operation I/O Statements 12<br />

REWIND 3<br />

Consider the following statement:<br />

REWIND (UNIT=9, IOSTAT=IOS, ERR=10)<br />

This statement positions the file connected to unit 9 at the beginning of the file. If an error occurs,<br />

control is transferred to the statement labeled 10, and a positive integer is stored in variable IOS.<br />

See Also<br />

• “Unit Specifier” for details on the UNIT control specifier<br />

• “Branch Specifiers” for details on the ERR control specifier<br />

• “I/O Status Specifier” for details on the IOSTAT control specifier<br />

• Building Applications for details on record position, advancement, and transfer<br />

UNLOCK Statement<br />

The UNLOCK statement frees a record in a relative or sequential file that was locked by a<br />

previous READ statement.<br />

The UNLOCK statement takes one of the following forms:<br />

UNLOCK ([UNIT=]io-unit [, ERR=label] [, IOSTAT=i-var])<br />

UNLOCK io-unit<br />

io-unit<br />

Is an external unit specifier.<br />

label<br />

Is the label of the branch target statement that receives control if an error occurs.<br />

i-var<br />

Is a scalar integer variable that is defined as a positive integer if an error occurs and zero if no error<br />

occurs.<br />

If no record is locked, the UNLOCK statement has no effect.<br />

Examples<br />

The following statement frees any record previously read and locked in the file connected to I/O<br />

unit 4:<br />

UNLOCK 4<br />

Consider the following statement:<br />

UNLOCK (UNIT=9, IOSTAT=IOS, ERR=10)<br />

12-43

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

Saved successfully!

Ooh no, something went wrong!