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.

INTRODUCTION<br />

1.2.3 Identifiers<br />

<strong>PASCAL</strong> uses the term identifier to mean the name of a program, module,<br />

constant, type, variable, procedure, or function. An identifier is a<br />

sequence of characters that CRn include letters, digits, dollar signs<br />

( $ ), and un de r 1 i n e s ym b 0 1 s ( ), wit h the foIl ow i ng res t ric t ion s :<br />

• An identifier can begin with any character other than a<br />

dig it.<br />

• An identifier must be unique in its first 31 characters<br />

within the block in which it is declared.<br />

• An identifier must not contain any blanks.<br />

<strong>PASCAL</strong> places no restrictions on the length of identifiers, but scans<br />

only the first 31 characters for uniqueness; the rest are ignored.<br />

~he following are examples of valid and invalid identifiers:<br />

Va 1 id<br />

Fo r2n8<br />

Max Words<br />

Upto<br />

$CREMBX<br />

Invalid<br />

4awhile (starts with a digit)<br />

Up&to (contains the ampersand)<br />

1.2.3.1 Predeclared Identifiers - <strong>PASCAL</strong> predeclares some identifiers<br />

as names of functions, procedures, types, values, and files. These<br />

predeclared identifiers are listed in Table 1-2 and appear in<br />

uppercase characters throughout this manual.<br />

Table 1-2:<br />

Predeclared Identifiers<br />

------<br />

ABS EXP OPEN SINGLE<br />

ARCTAN EXPO ORD SNGL<br />

BOOLEAN FALSE OUTPUT SQR<br />

CARD FIND PACK SQRT<br />

CHAR GET PAGE SUCC<br />

CHR HALT PRED TEXT<br />

CLOCK INPU1r PUT TIME<br />

CLOSE INTEGER READ TRUE<br />

COS LINELIMIT READLN TRUNC<br />

DATE LN REAL UNDEFINED<br />

DISPOSE MAXINT RESET UNPACK<br />

DOUBLE NEW REWRITE WRITE<br />

EOF ODD ROUND WRITELN<br />

EOLN<br />

SIN<br />

------<br />

You can redefine a predeclared identifier to denote some other item.<br />

Doing so, however, means that you can no longer use the identifier for<br />

its usual purpose within the scope of the block in which it is<br />

redefined.<br />

For example, the predeclared identifier READ denotes the READ<br />

procedure, which performs input operations. If you use the word READ<br />

to denote something else, such as a variable, you cannot use the READ<br />

procedure. Because you could lose access to useful language features,<br />

you should avoid redefining predeclared identifiers.<br />

1-7

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

Saved successfully!

Ooh no, something went wrong!