Inspect Manual

Using Inspect With Pascal
Inspect Manual429164-006
12-10
Record Types
Examples
In the following type and variable declarations, link is defined as a pointer type
pointing to a record of type object. The variables base and p are declared as
pointers of type link:
TYPE
link = ^object;
object = RECORD
next : link;
data : char
END;
VAR
base, p : link;
This example displays the pointer variable p, the record to which it points, a field of that
record, and then a field in the record to which the record p^.next points:
-PASOBJ-DISPLAY p
P= value of the pointer
-PASOBJ-DISPLAY p^
NEXT= value of field in record to which p points
DATA= value of field in record to which p points
-PASOBJ-DISPLAY p^.next
P.NEXT= value of field in record to which p points
-PASOBJ-DISPLAY p^.next^.data
P.NEXT.DATA= value of field in next record in chain
Record Types
Inspect supports Pascal standard records, variant records, and free type-unions.
When you refer to a variable of a variant record type, Inspect accesses only the active
fields and displays the proper values. Inspect does not display irrelevant fields.
When you refer to a field of a free type-union variable, the data type of the field
determines how Inspect displays the values. If you refer to a free type-union variable
without specifying a field, Inspect displays each of the possible field variants.
Examples Using a Standard Record
To access a single element of a structure, Inspect requires full name qualification. This
code fragment declares a standard record:
TYPE
tmprec =
RECORD
var1 : integer;
var2 : integer
END;