31.12.2013 Views

TOPS-20 PASCAL Language Manual - Bitsavers

TOPS-20 PASCAL Language Manual - Bitsavers

TOPS-20 PASCAL Language Manual - Bitsavers

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.

INPUT AND OUTPUT<br />

7.7 THE OPEN PROCEDURE<br />

The OPEN procedure does not actually open a file but rather allows you<br />

to specify file attributes. You cannot use OPEN on a file th~t has<br />

had a RESET or REWRITE done, or on the predeclared file INPUT.<br />

Fo rma t 1<br />

Format 2<br />

OPEN (file variable [ ,file name E [,history E<br />

IT ,record length E [,record-access-method E<br />

[ ,record type E [,carriage control E );<br />

OPEN<br />

(FILE VARIABLE := file variable<br />

[ ,FILE NAME := file name E<br />

[ ,HISTORY := history status E<br />

[ ,RECORD LENGTH := positive integer E<br />

[ ,RECORD-ACCESS METHOD := record-access-mode E<br />

[ ,RECORD-TYPE :~ record type E<br />

[ CARRIAGE CONTROL .= carriage control D );<br />

where:<br />

file variabJe<br />

specifies the <strong>PASCAL</strong> file variable associated<br />

with the file. You cannot open the<br />

predeclared file variable INPUT.<br />

(internal files)<br />

This parameter is ignored for internal files.<br />

The system creates a unique name for each<br />

internal file.<br />

(external files)<br />

file name<br />

provides information about the file to<br />

<strong>TOPS</strong>-<strong>20</strong>. The file name can be a variable or<br />

constant identifier defined as type PACKED<br />

ARRAY (l .• n] OF CHAR, or a file specification<br />

enclosed in apostrophes (for example,<br />

'PS:(MASELLA)BOOKS.DAT') .<br />

If you omit the file name, <strong>PASCAL</strong> will first<br />

attempt to use the file variable identifier<br />

as a logical name. If that name is not<br />

defined, <strong>PASCAL</strong> will use the defaults shown<br />

in Table 7-1.<br />

The file variable and the file name parameters designate the file to<br />

be opened. The remaining parameters specify attributes for the file<br />

and are summarized in Table 7-2, in Section 7.7.5. Except for the<br />

file variable name, all parameters are optional. Any parameters you<br />

specify, however, must be in the order shown above unless you use<br />

keywo rd syn tax.<br />

You can specify either the value of the parameter or the keyword and<br />

the value of the parameter. You can also use a combination.<br />

7-8

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

Saved successfully!

Ooh no, something went wrong!