IBM AS/400 Frozen Dessert Maker User Manual


 
Stepping Through the Program Object
3 DIM(3) CTDATA
Compile-time data: **
> EVAL TableA ** Show value at aaa
TABLEA = 'aaa' current index bbb
ccc
> EVAL TableA(1) ** Specify index 1 **
TABLEA(1) = 'aaa'
> EVAL TableA(2) ** Specify index 2 **
TABLEA(2) = 'bbb'
> EVAL _QRNU_TABI_TableA ** Display value of current index **
_QRNU_TABI_TABLEA = 1
> EVAL TableA(1..3) ** Specify the whole table **
TABLEA(1) = 'aaa'
TABLEA(2) = 'bbb'
TABLEA(3) = 'ccc'
> EVAL TableA=%INDEX(3) ** Change current index to 3 **
> EVAL TableA
TABLEA = 'ccc'
Figure 99. Sample EVAL commands for a Table
Displaying Data Structures
You display the contents of a data structure or its subfields as you would any
standalone field. You simply use the data structure name after EVAL to see the
entire contents, or the subfield name to see a subset.
When displaying a multiple-occurrence data structure, an EVAL on the data struc-
ture name will show the subfields using the current index. To specify a particular
occurrence, specify the index in parentheses following the data structure name. For
example, to display the contents of the second occurrence of DS1, type:
EVAL DS1(2)
Similarly, to view the contents of a particular occurrence of a subfield, use the index
notation.
To determine the value of the current index, enter the following command:
EVAL _QRNU_DSI_name
where
name
represents the data structure name in question.
If a subfield is defined as an array overlay of another subfield, to see the contents
of the overlay subfield, you can use the %INDEX built-in function to specify the
occurrence, and the index notation to specify the array.
An alternative way of displaying a subfield which is an array overlay is to use the
following notation:
EVAL subfield-name(occurrence-index,array-index)
where the variable
subfield-name
is the name of the subfield you wish to display,
occurrence-index
is the number of the array occurrence to display, and
array-index
is the number of the element to display.
Figure 100 on page 204 shows some examples of using EVAL with the the data
structures defined in DBGEX.
Chapter 11. Debugging Programs 203