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

When you reach the end of the file and you request a GET operation,<br />

EOF automatically becomes TRUE, and the file buffer variable becomes<br />

undefined. When EOF is TRUE, you cannot use the GET procedure.<br />

P~SCAL signals a run-time error, and program execution is aborted.<br />

Example<br />

BEGIN<br />

GET<br />

(Phones);<br />

END;<br />

This example reads the next component of the file Phones into the file<br />

buffer variable Phones A • EOF(Phones) must be FALSE; if it is TRUE,<br />

an error occurs.<br />

7.6 THE LINELIMIT PROCEDURE<br />

The LINELIMIT procedure terminates execution of the program after a<br />

specified number of lines have been written into a text file.<br />

Format<br />

where:<br />

LINELIMIT (file variable, n);<br />

file variable<br />

specifies the text file to which<br />

applies.<br />

this limit<br />

n<br />

represents<br />

indicating<br />

written to<br />

terminates.<br />

a positive<br />

the number<br />

the file<br />

integer expression<br />

of lines that can be<br />

before execution<br />

When <strong>PASCAL</strong> initializes a text file, it specifies a large default line<br />

limit. You can override this limit by calling LINELIMIT with your<br />

desired value.<br />

After the number of lines output to the file has reached the line<br />

limit, program execution terminates.<br />

Example<br />

BEGIN<br />

LINELIMIT (Debts,100);<br />

Execution of the program terminates after 100 lines have been<br />

into the text file Debts.<br />

written<br />

7-7

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

Saved successfully!

Ooh no, something went wrong!