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.

PROCEDURES AND FUNCTIONS<br />

Table ~-l:<br />

Predeclared Procedures (Cont.)<br />

Procedure<br />

Parameter Type<br />

Action<br />

READ(f, vl, ... ,vn)<br />

READLN(f, vl, ... ,vn)<br />

RELEASE(a)<br />

RESET(f)<br />

REWRITE ( f)<br />

UNPACK(z,a,i)<br />

f file variable<br />

vl, .•. ,vn<br />

variables<br />

f text file<br />

variable vl, ... ,vn<br />

variables<br />

a a variable<br />

type "INTEGER<br />

f<br />

f<br />

f i 1 e variable<br />

file variable<br />

of<br />

z = variable of type<br />

PACKED ARRAyru •• vl<br />

OF t<br />

a = variable of type<br />

ARRAY fm .. nl OF T<br />

i = starting index<br />

in array a<br />

For vI through vn,<br />

RE~D assigns the<br />

next value in the<br />

input file f to the<br />

variable. You must<br />

specify at least one<br />

variable (vI). The<br />

default for f is<br />

INPUT.<br />

Performs the READ<br />

procedure for vI<br />

through vn, then<br />

sets the current<br />

file position to the<br />

beginning of the<br />

next line. The<br />

variable list is<br />

optional. The<br />

default or f is<br />

INPUT.<br />

Deallocates memory<br />

allocated by the NEW<br />

procedure up to the<br />

point set by<br />

MARK procedure.<br />

the<br />

Enables read i ng from<br />

file f • RESET (f)<br />

moves the current<br />

file position to the<br />

beginning of file f<br />

and assigns the<br />

first component of f<br />

to the file buffer<br />

variable, f ".<br />

EOF(f) is set to<br />

FALSE unless the<br />

file is empty.<br />

Enables writing ~o<br />

file f. REWRITE(f)<br />

sets the file f to<br />

zero length and sets<br />

EOF (f) to TRUE.<br />

Moves (v-u+l)<br />

elements from array<br />

z to array a by<br />

assigning elements<br />

z (u] through z (vl to<br />

a[i]<br />

ari+v-u].<br />

through<br />

The upper<br />

bound of a must be<br />

greater than or<br />

equal to (i+v-u).<br />

6-4

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

Saved successfully!

Ooh no, something went wrong!