IBM AS/400 Frozen Dessert Maker User Manual


 
Stepping Through the Program Object
| Displaying UCS-2 Data
| The value displayed for UCS-2 fields has been translated into readable characters.
| For example, if a UCS-2 field has been set to %UCS2('abcde'), then the value dis-
| played for that field would be 'abcde'. You can display UCS-2 data in any field by
| using the :u suffix for EVAL.
| Displaying Variable-Length Fields
| When you use EVAL fldname for a variable length field, only the data portion of the
| field is shown. When you use any suffix such as :c or :x for the field, the entire field
| including the length is shown. To determine the current length of a variable length
| field, use EVAL fldname:x. The length is the first four hexadecimal digits, in binary
| format. You must convert this value to decimal form to get the length; for example,
| if the result is 003DF1F2..., the length is 003D which is (3 * 16) + 13 = 61.
Displaying Data Addressed by Pointers
If you want to see what a pointer is pointing to, you can use the EVAL command
with the :c or :x suffix. For example, if pointer field PTR1 is pointing to 10 bytes of
character data,
EVAL PTR1:c 10
will show the contents of those 10 bytes.
You can also show the contents in hexadecimal using:
EVAL PTR1:x 10
This would be especially useful when the data that the pointer addresses is not
stored in printable form, such as packed or binary data.
Displaying Null-Capable Fields
You can use the EVAL debug command to display the null indicator of a null-
capable field. The null indicator is an internal variable (similar to the index variable
for multiple-occurrence DS) which is named _QRNU_NULL_fieldname. The
fieldname can be the name of an array if the array is null-capable.
When the debugger displays a null-capable field, the content of the field is dis-
played regardless of whether the field is considered null. For example, suppose
FLD1 is null-capable, and is currently null. Then the result of EVAL
_QRNU_NULL_FLD1 is '1' and EVAL FLD1 shows the current content of FLD1,
even though its null indicator is on.
EVAL _QRNU_NULL_FLD1 Result: _QRNU_NULL_FLD1 = '1'
EVAL FLD1 Result: FLD1 = 'abcde'
Using Debug Built-In Functions
The following built-in functions are available while using the ILE source debugger:
%SUBSTR
Substring a string field.
%ADDR Retrieve the address of a field.
%INDEX Change the index of a table or multiple-occurrence data structure.
%VARS Identifies the specified parameter as a variable.
206 ILE RPG for AS/400 Programmer's Guide