HP Pascal/iX Programmer's Guide (31502-90023)

7- 5
(varp), and a READONLY parameter (readonlyp).
Conformant Array Parameters
A
conformant array parameter
is a formal array parameter defined by a
conformant array schema
(the syntax appears in the
HP Pascal/iX Reference
Manual
or the
HP Pascal/HP-UX Reference Manual
). Its actual parameter
must be an array variable that conforms to the schema.
An array variable conforms to a conformant array schema if all of the
following are true:
* The variable and the schema are both PACKED, or neither is PACKED.
* The index types of the variable and the schema are compatible (as
defined in the
HP Pascal/iX Reference Manual
or the
HP Pascal/HP-UX Reference
Manual
).
* The bounds of the index type of the variable are within the bounds
of the index type of the schema.
* The element types of the variable and the schema are the same,
unless the element type of the schema is another schema. If the
element type of the schema is another schema, the element type of
the variable conforms to the other schema.
Example 1
TYPE
itype = 0..20;
jtype = 'a'..'z';
ktype = 0..5;
VAR
var1 : ARRAY [0..10] OF integer;
PROCEDURE p (yes : ARRAY [lb1..ub1 : itype] OF integer;
no1 : PACKED ARRAY [lb3..ub3 : itype] OF integer;
no2 : ARRAY [lb4..ub4 : jtype] OF integer;
no3 : ARRAY [lb5..ub5 : ktype] OF integer;
no4 : ARRAY [lb6..ub6 : itype] OF real;
no5 : ARRAY [lb7..ub7 : itype;
lb8..ub8 : itype] OF integer);
The array variable var1 conforms to the schemas of the conformant array
parameter yes. Var1 and the schema of yes have the same element type,
and 0..10 is within the bounds of itype.
The variable var1 does not conform to the schemas of conformant array
parameters no1, no2, no3, no4, and no5. The following table gives the
reasons for nonconformance.
Parameter Why
var1
Does Not Conform to Schema
no1 Schema is PACKED and
var1
is not PACKED.
no2 Index types of
var1
and schema are not compatible.
no3 Bounds of index type of
var1
are not within bounds of index
type of schema.
no4 Element types of
var1
and schema are different.
no5 Schema specifies two dimensions, and
var
has only one
dimension.
Like array declarations, schemas can specify dimensions in syntactically