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.7 BACKSPACE Statement<br />

<br />

BACKSPACE u<br />

BACKSPACE (alist)<br />

where:<br />

u<br />

alist<br />

is an external unit identifier.<br />

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

[UNIT =] u<br />

IOSTAT = ios<br />

ERR = s<br />

Execution of a BACKSPACE statement causes the file connected to the specified unit to be positioned at the<br />

beginning of the preceding record. If the preceding record is an endfile record then the file is positioned at<br />

the beginning of the endfile record.<br />

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

Example:<br />

LOOP<br />

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

ENDLOOP<br />

100 BACKSPACE( UNIT=8 )<br />

WRITE( UNIT=8, FMT=200 ) NEWREC<br />

In the previous example, we illustrate how one might append a record to the end of an existing file.<br />

Notes:<br />

1. The unit must be connected for sequential access.<br />

2. If the file is positioned before the first record then the BACKSPACE statement has no effect.<br />

3. It is illegal to backspace a file that does not exist.<br />

BACKSPACE Statement 19

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

Saved successfully!

Ooh no, something went wrong!