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.

<strong>PASCAL</strong> DATA TYPES<br />

Records of differing types are compatible if they meet the following<br />

criteria:<br />

• They have the same number of fields.<br />

• Corresponrling field types are compatible.<br />

•<br />

Both are packed, or neither is<br />

packed, corresponding fields<br />

equal bounds.<br />

packed. If<br />

of subrange<br />

the types are<br />

types must have<br />

The following type is also compatible with Life and Plantlife:<br />

TYPE Coords = RECORD<br />

X : INTEGER,<br />

Y : O •• lOO<br />

END;<br />

The integer subrange O .. 100 is compatible with the type INTEGER.<br />

However, <strong>PASCAL</strong> does not check for valid assignments to fields of<br />

subrange types. If you assign a record of type Life to a record of<br />

type Coord, you must ensure that the value of the field Died is within<br />

the subrange O .• 100. An out-of-range assignment does not result in an<br />

error message.<br />

If the records have variants, these criteria also apply:<br />

• The records must have the same number of variants.<br />

• Corresponding variants must have the same number of fields.<br />

• Corresponding field types within corresponding variants must<br />

be compa t i bl e.<br />

• The case labels associated with the variants must agree in<br />

number, but need not agree in value.<br />

• Corresponding variants in structurally compatible records<br />

must have identical tag constant values.<br />

• The tag constant lists in each record must be identical.<br />

2-<strong>20</strong>

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

Saved successfully!

Ooh no, something went wrong!