HP Pascal/iX Reference Manual (31502-90022)

3- 15
NOTE One asterisk (*) after a routine name indicates that this routine
can be used on all arrays, whereas two asterisks (**) indicates
that this routine should be used with PAC arrays only.
Example
TYPE
name = PACKED ARRAY [1..30] OF char; { PAC type }
list = ARRAY [1..100] OF integer;
strange = ARRAY [Boolean] OF char;
flag = ARRAY [(red, white, blue)] OF 1..50;
files = ARRAY [1..10] OF text;
Multi-Dimensioned Arrays
If an array definition specifies more than one index type or if the
components of an array are themselves arrays, then the array is said to
be
multi-dimensioned
. The maximum number of array dimensions is
implementation dependent.
Example
TYPE
{ equivalent definitions of truth }
truth = ARRAY [1..20] OF
ARRAY [1..5] OF
ARRAY [1..10] OF Boolean;
truth = ARRAY [1..20] OF
ARRAY [1..5, 1..10] OF Boolean;
truth = ARRAY [1..20, 1..5] OF
ARRAY [1..10] OF Boolean;
truth = ARRAY [1..20, 1..5, 1..10] OF Boolean;
FILE
This reserved word designates a declared data structure that consists of
a sequence of components all of the same type.
Files
are usually
associated with peripheral storage devices, and their length is not
specified in the program. A
file_type
consists of the reserved words
FILE OF and a component type that may be predefined or user-defined. The
type
text
is a special type of FILE OF CHAR that has additional
attributes. For further information about textfiles, refer to the
section "Standard Textfiles" in this chapter.
A
logical
file is a file variable declared in an HP Pascal program. A
physical
file is a file that exists in the environment outside the
program and is controlled by the operating system. During program
execution, logical files are associated with physical files, allowing any
operation performed on the logical file to be performed on the physical
file. Thus, a program is allowed to manipulate data in the external
environment.
A logical file may be any type except a file type or a structured type
with a file type component. The number of components is not fixed by the
file type definition. File components may be accessed sequentially or
directly using a variety of HP Pascal standard procedures and functions.
It is legal to declare a
packed
file. The effect on the storage of the
file is implementation dependent.
Syntax