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

LOGICAL EX, OD<br />

CHARACTER*30 FN<br />

INQUIRE( UNIT=7, EXIST=EX, OPENED=OD, NAME=FN )<br />

In the above example, information is requested on unit 7. In particular, we want to know if the unit exists,<br />

whether it is connected to a file, and, if so, what the file name is.<br />

2.55.3 Inquiry Specifiers<br />

The following inquiry specifiers are supported.<br />

IOSTAT = ios<br />

ERR = s<br />

EXIST = ex<br />

OPENED = od<br />

NUMBER = num<br />

NAMED = nmd<br />

NAME = fn<br />

ACCESS = acc<br />

SEQUENTIAL = seq<br />

DIRECT = dir<br />

FORM = fm<br />

FORMATTED = fmt<br />

UNFORMATTED = unf<br />

RECL = rcl<br />

NEXTREC = nr<br />

BLANK = blnk<br />

As an extension to the <strong>FORTRAN</strong> <strong>77</strong> language, the following inquiry specifiers are also supported.<br />

ACTION = act<br />

CARRIAGECONTROL = cc<br />

RECORDTYPE = rct<br />

BLOCKSIZE = bl<br />

IOSTAT = ios is an input/output status specifier. The integer variable or integer array element ios is<br />

defined with zero if no error condition exists or a positive integer value if an error condition<br />

exists.<br />

ERR = s<br />

EXIST = ex<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 />

ex is a logical variable or logical array element.<br />

Inquire by file: The value .TRUE. is assigned if a file exists with the specified name;<br />

otherwise the value .FALSE. is assigned.<br />

Inquire by unit: The value .TRUE. is assigned if the specified unit exists; otherwise the<br />

value .FALSE. is assigned.<br />

OPENED = od od is a logical variable or logical array element.<br />

94 INQUIRE Statement

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

Saved successfully!

Ooh no, something went wrong!