IBM AS/400 Frozen Dessert Maker User Manual


 
Stepping Through the Program Object
Display Module Source
Program: DEBUGEX Library: MYLIB Module: DBGEX
141
142 *=============================================================
143 * Define the subprocedure Switch.
144 *=============================================================
145 P Switch B
146 D Switch PI
147 D Parm 1A
148 *---------------------------------------------------------
149 * Define a local variable for debugging purposes.
150 *---------------------------------------------------------
151 D Local S 5A INZ('aaaaa')
152
153 C IF Parm = '1'
154 C EVAL Parm = '0'
155 C ELSE
Debug . . . _________________________________________________________________
_______________________________________________________________________________
F3=End program F6=Add/Clear breakpoint F10=Step F11=Display variable
F12=Resume F17=Watch variable F18=Work with watch F24=More keys
Step completed at line 145.
Figure 95. Stepping into Subprocedure Switch
Displaying Data and Expressions
You can display the contents of fields, data structures, and arrays, and you can
evaluate expressions. There are two ways to display or evaluate:
F11 (Display Variable)
EVAL debug command
The scope of the fields used in the EVAL command can be defined by using the
QUAL command in languages such as ILE C. However, this command does not
currently apply to ILE RPG,
Note: You cannot display return values because there is no external name avail-
able for use with the EVAL debug command.
The easiest way to display data or an expression is to use F11 (Display variable)
on the Display Module Source display. To display a field using F11 (Display vari-
able), place your cursor on the field that you want to display and press F11
(Display variable). The current value of the field is shown on the message line at
the bottom of the Display Module Source display.
In cases where you are evaluating structures, records, or arrays, the message
returned when you press F11 (Display variable) may span several lines. Messages
that span several lines are shown on the Evaluate Expression display to show the
entire text of the message. Once you have finished viewing the message on the
Evaluate Expression display, press Enter to return to the Display Module Source
display.
To display data using the EVAL debug command, type:
EVAL field-name
Chapter 11. Debugging Programs 199