HP Pascal/iX Reference Manual (31502-90022)

5- 4
NIL
This predefined constant is the value of a
pointer
that designates that
the pointer does not point at anything. NIL is compatible with any
pointer type. A NIL pointer or pointer that has been assigned to NIL
does not point to any variable at all. It is an error to dereference a
NIL valued pointer.
NIL pointers are useful in linked list applications where the link
pointer points to the next element of the list. The last element's
pointer can be assigned to NIL to indicate that there are no further
elements in the list.
Array Constants and Array Constructors
An
array constant
is a declared constant defined with an array
constructor that specifies values for the components of an array type.
The values for all elements of the structured type must be specified and
must have a type identical to the type of the corresponding elements.
An
array constructor
consists of a previously defined array type
identifier and a list of values in square brackets. Array constructors
are only legal in a CONST section of a declaration part. They cannot
appear in other sections or in executable statements. Each component of
the array type must receive a value that is assignment compatible with
the component type. There is a shorthand allowed for PAC and string
constants where a string literal may be used to assign values to multiple
components. An array constant may not contain files.
An array constant may be used to initialize a variable in the executable
part of a block. Individual components of an array constant may also be
accessed in the body of a block, but not in the definition of other
constants.
Within the square brackets, the reserved word OF indicates that a value
occurs repeatedly. For example, 3 OF 5 assigns the integer value 5 to
three successive array components. The symbols (. and .) may replace
the left and right square brackets, respectively.
Syntax
Array_constructor
Example
TYPE
Boolean_table = ARRAY [1..5] OF Boolean;
table = ARRAY [1..100] OF integer;
row = ARRAY [1..5] OF integer;
matrix = ARRAY [1..5] OF row;
color = (red, yellow, blue);
color_string = PACKED ARRAY [1..6] OF char;
color_array = ARRAY [color] OF color_string;