Inspect Manual

High-Level Inspect Commands
Inspect Manual429164-006
6-40
Examples
Items declared as arrays are displayed using the subscript range specified in the
command. If none is specified, then the items are displayed in their entirety.
A one-dimensional item is displayed as a row of values, the name indicating the
beginning subscript value. For example, assume this COBOL definition:
01 person-name.
03 last-n.
05 last-char PICTURE X OCCURS 20 TIMES.
03 rest.
05 first-char PICTURE X OCCURS 20 TIMES.
Inspect then displays this item as follows:
Examples
These examples display program data, based on this source code.
1. This example shows the result of displaying an array of 8 elements.
-PRG-DISPLAY person-name
PERSON-NAME =
LAST-N =
LAST-CHAR[1] = "DINGERDORFF "
REST =
FIRST-CHAR[1] = "MOSTOK R. "
?inspect,symbols
STRUCT S^Def ( * );
BEGIN
INT one^field;
INT two^field;
END;
PROC example MAIN;
BEGIN
INT arr[0:7] := [ 12345, 5, 123, 2, 901, 89, 567, 0 ];
STRING s1 [0:6]; STRUCT def^one(S^Def);
STRING .string_ptr;
def^one.one^field := 1;
def^one.two^field := 22;
s1 ':=' "example";
@string_ptr := @s1;
END;
-EX2OBJ-DISPLAY arr
ARR[0] = 12345 5 123 2 901 89 567 0