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

BLANK = blnk<br />

blnk is a character expression whose value when trailing blanks are removed is ’NULL’<br />

or ’ZERO’. If ’NULL’ is specified then all blank characters in numeric formatted input<br />

fields are ignored except that an entirely blank field has a value of zero. If ’ZERO’ is<br />

specified then all blank characters other than leading blanks are treated as zeroes. If this<br />

specifier is omitted then ’NULL’ is assumed. This specifier may only be present for a file<br />

being connected for formatted input/output.<br />

ACTION = act<br />

act is a character expression whose value when trailing blanks are removed is ’READ’,<br />

’WRITE’ or ’READWRITE’. If ’READ’ is specified, data can only be read from the<br />

file. If ’WRITE’ is specified, data can only be written to the file. If ’READWRITE’ is<br />

specified, data can both be read and written. The default is ’READWRITE’.<br />

CARRIAGECONTROL = cc<br />

cc is a character expression whose value when trailing blanks are removed is ’YES’, or<br />

’NO’. If ’YES’ is specified, <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong> will automatically add an<br />

extra character at the beginning of each record. This character will be interpreted as a<br />

carriage control character. If ’NO’ is specified, records will be written to the file without<br />

adding a carriage control character at the beginning of the record. The default is ’NO’.<br />

RECORDTYPE = rct<br />

rct is a character expression whose value when trailing blanks are removed specifies the<br />

type of record (or record structure) to be used for the file. The allowed values for rct<br />

depend on the system on which you are running the program. See the compiler User’s<br />

Guide for a discussion of the RECORDTYPE= specifier.<br />

BLOCKSIZE = bl<br />

bl is an integer expression whose value specifies the internal buffer size to be used for file<br />

input/output. The allowed values for bl depend on the system on which you are running<br />

the program. Generally, the larger the buffer, the faster the input/output. See the compiler<br />

User’s Guide for a discussion of the BLOCKSIZE= specifier.<br />

SHARE = shr<br />

shr is a character expression whose value when trailing blanks are removed specifies the<br />

way in which other processes can simultaneously access the file. The allowed values for<br />

shr depend on the system on which you are running the program. See the compiler User’s<br />

Guide for a discussion of the SHARE= specifier.<br />

Example:<br />

OPEN( UNIT=1, FILE=’TEST’, STATUS=’UNKNOWN’,<br />

+ ACCESS=’SEQUENTIAL’,<br />

+ FORM=’FORMATTED’, BLANK=’ZERO’ )<br />

In the above example, the file ’TEST’, containing FORMATTED records, is connected to unit 1. The<br />

status of the file is ’UNKNOWN’ since we do not know if it already exists. We will access the file<br />

sequentially, using formatted input/output statements. Blanks in numeric input data are to be treated as<br />

zeroes.<br />

OPEN Statement 113

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

Saved successfully!

Ooh no, something went wrong!