HP Pascal/iX Reference Manual (31502-90022)

3- 11
A
subrange
type is a user-defined, ordinal type that is a sequential
subset of a predefined or user-defined, ordinal base type. It consists
of a lower bound and an upper bound separated by the special symbol "..".
The upper and lower bounds must be constant values or constant
expressions of the same ordinal type. The lower bound cannot be greater
than the upper bound.
Syntax
Subrange_type:
NOTE A variable of a subrange type possesses all the attributes of the
base type of the subrange, but its values are restricted to the
specified closed range. It has the same set of permissible
operators and standard functions as its base type.
Standard Procedures
prompt strread
read strwrite
readdir writedir
readln writeln
Example
CONST
maxsize = 10;
TYPE
day_of_year = 1..366;
lowercase = 'a'..'z'; { Base type is char. }
days = (Monday, Tuesday, Wednesday,
Thursday,Friday,Saturday,Sunday);
weekdays = Monday..Friday;
weekend = Saturday..Sunday;
e_type = 1..maxsize - 1; { Upper bound is con- }
{ stant expression. }
{ Maxsize is declared }
{ constant. }
Real
The
real
type is a predefined, simple type that represents a subset of
the real numbers. For the range covered by the subset, see the
HP
Pascal/iX Programmer's Guide
or the
HP Pascal/HP-UX Programmer's Guide
,
depending on your implementation.
Permissible Operators
assignment :=
relational <, <=, =, <>, >=, >
arithmetic -, +, *, /
Standard Functions