HP Pascal/iX Reference Manual (31502-90022)

5- 6
Example
TYPE
securtype = (light, medium, heavy);
counter = RECORD
pages: integer;
lines: integer;
characters: integer;
END;
report = RECORD
revision: char;
price: real;
info: counter;
CASE securtag: securtype OF
light: ();
medium: (mcode: integer);
heavy: (hcode: integer;
password: string[10]);
END;
CONST
no_count = counter [pages: 0, characters: 0, lines: 0];
big_report = report [revision: 'B',
price: 19.00,
info: counter [pages: 19,
lines: 25,
characters: 900],
securtag: heavy,
hcode: 999,
password: 'unity'];
no_report = report [revision : ' ';
price : 0.00;
info : no_count;
securtag : light];
Restricted Set Constructor
A set constant is a declared constant defined with a
restricted set
constructor
that specifies set values. A restricted set constructor
consists of an optional previously declared set type identifier and a
list of constant values in square brackets. Subranges may appear in this
list. Restricted set constructors may appear in a CONST section of a
declaration part, or in executable statements and can be used to
initialize a set variable in the body block.
The constant must be an ordinal constant value or an ordinal subrange. A
constant expression is legal as a value. The symbols (. and .) may
replace the left and right square brackets, respectively.
Syntax
Restricted_set_constructor: