CL Programming

Stepping through the Program Object

After a breakpoint is encountered, you can run a specified number of statements of a program object, then stop the program again and return to the Display Module Source display. The program object begins running on the next statement of the module object in which the program stopped. Typically, a breakpoint is used to stop the program object.

You can step through a program object by using:

Using F10 or F22 on the Display Source Display

The simplest way to step through a program object one statement at a time is to use F10 (Step) or F22 (Step into) on the Display Module Source display. When you press F10 (Step) or F22 (Step into), then next statement of the module object shown in the Display Module Source display is run, and the program object is stopped again.

Note:
You cannot specify the number of statements to step through when you use F10 (Step) or F22 (Step into). Pressing F10 (Step) or F22 (Step into) performs a single step.

Another way to step through a program object is to use the STEP debug command. The STEP debug command allows you to run more than one statement in a single step.

Using the STEP Debug Command

The default number of statements to run, using the STEP debug command, is one. To step through a program object using the STEP debug command, type:

STEP number-of-statements

on the debug command line. Number-of-statementsis the number of statements of the program object that you want to run in the next step before the program object is halted again. For example, if you type

STEP 5

on the debug command line, the next five statements of your program object are run, then the program object is stopped again and the Display Module Source display is shown.

Step Over and Step Into

When a CALL statement to another program object is encountered in a debug session, you can do either of the following:

If you choose to step over the called program object, then the CALL statement and the called program object are run as a single step. The called program object is run to completion before the calling program object is stopped at the next step. Step over is the default step mode.

If you choose to step into the called program object, then each statement in the called program object is run as a single step. If the next step at which the running program object is to stop falls within the called program object, the called program object is halted at this point. The called program object is then shown in the Display Module Source display if the called program object is compiled with debug data and you have the correct authority to debug it.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]