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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

I~PUT<br />

AND OUTPUT<br />

7.2.1 Fixed-Length Records<br />

When you specify fixed-length records, you ~re specifying that all<br />

records in the file contain the same number of bytes. A file opened<br />

for direct access must cont3in fixed-length records to allow the<br />

record location to be computed correctly. All binary files (that is,<br />

all files except TEXT files) must have fixed-length records. P~SCAL<br />

does not support binary files with variable-length records.<br />

7.2.2 Variable-Length Records<br />

Variable-length records can contain any nUffiber of byt~s up to the<br />

buffer size specified when the file was opened. TEXT files must have<br />

variable-length records. <strong>PASCAL</strong> does not support TEXT files with<br />

fixed-length rec~rds.<br />

7.3 THE CLOSE PROCEDURE<br />

The CLOSE procedure closes an open file.<br />

Fo rma t.<br />

CLOSE (file variable);<br />

where:<br />

file variable<br />

specifies the file to be closed.<br />

Execut.ion of this procedure causes the system to close t.he file. Each<br />

file is automatically closed upon exit from the procedure in which it<br />

is declared, except those which have been dynamically allocated with<br />

the procedure NEW. These files should be explicitly closed; if not,<br />

they are automatically closed when the program ends, or when they are<br />

DISPOSED.<br />

You can close only files that have been opened explicitly with the<br />

OPEN procedure or implicitly by the RESET or REWRITE procedure.<br />

Therefore, you cannot close the predeclared file variables INPUT and<br />

OUTPUT.<br />

Example<br />

CLOSE (AlbulTls);<br />

This procedure closes the file Albums to further access, and deletes<br />

the file if it is internal to the current program.<br />

7.4 THE FIND PROCEDURE<br />

The FIND procedure positions a file pointer at a<br />

in the file.<br />

specified component<br />

Fo rma t<br />

FIND (file variable, integer expression);<br />

7-4

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

Saved successfully!

Ooh no, something went wrong!