Sheltran - I/O statements
Form:
...,ERR=<exit specifier>,...
and/or
...,END=<exit specifier>,...
Notes:
- The following I/O statements are recognized: READ, WRITE, OPEN,
CLOSE, REWIND, BACKSPACE, INQUIRE, ENDFILE.
- <exit specifier> can be any one of the following: XWHILE,
XREPEAT, XFOR, STOP, RETURN or <procedure name>.
- The exit specification must appear on the first line of the I/O
statement.
Actions:
The use of <procedure name> is equivalent to a PERFORM of the
procedure between the I/O statement and the statement following it. The
use of the other items will have the normal SHELTRAN meaning.
Example:
WHILE .TRUE.
READ(1,FMT='(A)',END=XWHILE,ERR=ERRPRC) LINE
WRITE(2,FMT='(1X,A)',ERR=ERRPRC) LINE
CWHILE
.
.
.
PROC ERRPRC
REWIND 1
REWIND 2
CPROC