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.

EXPRESSIONS<br />

Similarly, local identifiers declared in Level 1B are accessible to<br />

LevellB, Level ~~B, and Level2C, but not to Level lA, Level ?A,<br />

Level-3A, or the nain program.<br />

In general, once you define an identifier, it retRins its meaning<br />

within the block containing its declaration. You can, however,<br />

redefine an identifier in a subprogram at a lower level. If you do<br />

so, the identifier assumes its new meaning only within the scope of<br />

the redefining block. Outside this block, the identifier keeps its<br />

original meRning. For example, B is declared at program level and<br />

redefined in Level 2C. Within the scope of Level 2C, B denotes a<br />

Boolean variable. ·Everywhere else in the program,-however, B denotes<br />

Rn integer.<br />

The identifiers accessible to each routine in Figure 3-1 are listed<br />

below.<br />

Routine<br />

-----<br />

Variables<br />

Main p:rog ram A, B ( :i. n t f::' ~.:.! f~ T' )<br />

l..evf~ll .... :LA<br />

A, B ( i ntt~~tp T') , r _. 1:1<br />

L..f?vf?l .... :?A A, B ( i nte5.!e T') y C , , Dy E<br />

Level.. .. 3A Ay B ( i ntf.~~J(·? T' ) , C, [I, [y r<br />

..<br />

LeVE' 1 __ :L B<br />

A, B ( :i. ntf.~~~e T' ) , G<br />

L f? V t~ 1 .. _ 2 B A, B ( integer) , (3y H<br />

Level .... 2C A, B (Boolean) , ,J<br />

3-9

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

Saved successfully!

Ooh no, something went wrong!