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.

INPUT AND OUTPUT<br />

The first reference to the file INPUT is the EOLN test in the WHILE<br />

statement. When the test is perfor~ed, the system attempts to read a<br />

line of input from the text file. Therefore, it is very important to<br />

prompt for the integer or empty line before testing for ROLN.<br />

Suppose you respond to the first prompt by supplying an integer as<br />

input. Access to the input device is delayed until the EOLN function<br />

makes the first reference to the file INPUT. The EOLN function causes<br />

a line of text to be read into the internal line buffer. The<br />

subsequent READLN procedure reads the input value from the line of<br />

text 8nd assigns it to the variable I. The WRITELN procedure writes<br />

the input value to the text file OUTPUT. The final statement in the<br />

WHILE loop is the request for another input value. The loop<br />

terminates when the EOLN detects the end-of-line marker.<br />

7-29

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

Saved successfully!

Ooh no, something went wrong!