IBM AS/400 manual Displaying Data and Expressions, Stepping Through the Program Object

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 223
Image 223
Figure 95. Stepping into Subprocedure Switch

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 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 b

QUAL command in languages such as ILE C.

However, this

command does no

currently

apply

to

ILE RPG,

 

 

 

 

 

 

 

Note:

You

cannot

display

return

values

because there

is

no external

 

able

for

use

with

the

EVAL

debug

command.

 

 

The

easiest

way

to

display

data

or

an

expression is to use F11

on the Display Module Source display. To

display a field using F11

able), place your cursor on the field that you want

to

display and

(Display variable).

The

current

value

of

the field is shown on the

the

bottom

of

the

Display Module

Source

display.

 

 

In cases where you are evaluating structures, records, or arrays, returned when you press F11 (Display variable) may span several lines that span several lines are shown on the Evaluate Expression display t entire text of the message. Once you have finished viewing the mes Evaluate Expression display, press Enter to return to the Display Modul display.

To display data using the EVAL debug command, type:

EVAL field-name

Chapter 11. Debugging Programs199

Page 223
Image 223
IBM AS/400 manual Displaying Data and Expressions, Stepping Through the Program Object, Stepping into Subprocedure Switch