Inspect Manual
Using Inspect With Pascal
Inspect Manual—429164-006
12-8
Array Types
Array Types
Inspect supports all Pascal array types, including multidimensional arrays and arrays of
records. You can use a single element, a group of elements, an entire array, or an
array type itself as the data-reference part of a data location:
If you use the array name only in any command other than INFO IDENTIFIER or
DISPLAY, Inspect displays the error:
Inspect performs bounds checking on Pascal arrays. If you attempt to access an
element outside of the array bounds, Inspect displays the error:
Examples
This example assume these Pascal declarations:
CONST subscript = 100;
TYPE intarray = ARRAY [1..subscript] OF INTEGER;
chararray = PACKED ARRAY [1..subscript] OF CHAR;
VAR a1 : intarray;
a2 : chararray;
This example displays an array element and then displays both arrays:
-PASOBJ-DISPLAY a1[5]
A1[5] = value of fifth element
-PASOBJ-DISPLAY a1
A1 = values of all elements of a1
-PASOBJ-DISPLAY a2
A2 = values of all elements of a2 as a string of CHARs
Enumerated Types
Inspect supports variables of enumerated types.
Data Reference Example Where Valid
Single element MYARRAY[5] In any Inspect command
Range of elements MYARRAY[1:7] In any Inspect command except BREAK
Entire array MYARRAY In the INFO IDENTIFIER and DISPLAY
commands only
Array type INTARRAY In the INFO IDENTIFIER command only
** Inspect error 80 ** Required subscript missing: identifier
** Inspect error 79 ** Subscript value outside of declared bounds: identifier