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.

CHAPTER 7<br />

INPUT AND OUTPUT<br />

This chapter describes input and output (I/O) for <strong>PASCAL</strong> on <strong>TOPS</strong>-<strong>20</strong>.<br />

<strong>PASCAL</strong> provides predefined procedures to perform input and output to<br />

file variables. These procedures are divided into the following<br />

categories:<br />

General Procedures<br />

• OPEN -- associates R file with specified characteristics<br />

• CLOSE -- closes a file<br />

• FIND -- performs direct access to file components<br />

Input Procedures<br />

• RESET -- opens a fiJe and prepares it for input<br />

• GET -- reads a file component into the file buffer variable<br />

• READ -- reads a file component into R specified variable<br />

• READLN -- reads a line from a text file<br />

Output Procedures<br />

• REWRITE -- truncates a file to length zero and prepares it<br />

for output<br />

• PUT -- writes the contents of the file buffer variable into<br />

the specified file<br />

• WRITE -- writes specified values into a file<br />

• WRITELN -- writes a line into a text file<br />

• LINELIMIT -- terminates program execution after a specified<br />

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

• PAGE -- skips to the next page of a text file<br />

In addition, you can use the predefined functions EOF and EOLN with<br />

text files.<br />

The following sections describe:<br />

• <strong>PASCAL</strong> file characteristics<br />

• <strong>PASCAL</strong> record formats<br />

7-1

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

Saved successfully!

Ooh no, something went wrong!