Intel fortran-80 manual Error Specifier, File Name Specifier, File Status Specifier

Models: fortran-80

1 130
Download 130 pages 742 b
Page 65
Image 65
6.2.1.3 Error Specifier

FORTRAN-80

Input/Output

Executing an OPEN statement containing this specifier causes 'stname' to become defined with a zero value if no error condition exists, or with a processor-dependent positive integer value if an error condition does exist.

Example:

OPEN (4, IOSTAT = ERRFLG)

6.2.1.3 Error Specifier

The format of the error specifier is

ERR = stl

where 'st!' is the label of an executable statement in the same program unit as the OPEN statement.

If the processor discovers an error condition while executing the OPEN statement, the following steps occur:

1.The OPEN operation terminates;

2.The position of the file specified by OPEN becomes indeterminate;

3.If the OPEN statement has an IOSTAT specifier, 'stname' is set to reflect the error condition;

4.Execution continues with the statement named by the ERR specifier.

Example:

OPEN (4, IOSTAT= ERRFLG,ERR= 1010)

6.2.1.4 File Name Specifier

The format of the file name specifier is

FILE = {name

where 'fname' is the name of the file to be connected, expressed as a character-type constant or variable. The file name must be valid for the particular system in which the program is executing. If FILE is omitted, the unit becomes connected to a processor-determined file.

Example:

OPEN(UNIT=3, FILE= 'MVPROG.SRC')

6.2.1.5 File Status Specifier

The format of the file status specifier is

STATUS = stat

where 'stat' is a character expression evaluating to 'OLD', 'NEW', 'SCRATCH', or 'UNKNOWN'. If the STATUS specifier is omitted, the default value is 'UNKNOWN'.

6-5

Page 65
Image 65
Intel fortran-80 manual Error Specifier, File Name Specifier, File Status Specifier