Programming Guide : Debugging Your Application : How Debugging an Application Works : How You Can Control Execution of Your Application
 
Share this page          
How You Can Control Execution of Your Application
You can invoke the Debugger by performing the procedure in Open the Debugger for an Application. When the Debugger has control, you can use the following navigation buttons on the Debugger window's toolbar to control the execution of your application:
Step
Executes a single statement, stepping across frame or procedure calls. For more information, see Step Button.
Step Into
Executes a single statement, but steps into a frame or procedure if the statement calls a frame or procedure. For more information, see Step Into Button.
Step To End
Continues execution to the next end, return, or resume statement. For more information, see Step To End Button.
Continue
Continues execution to the next break condition. For more information, see Continue Button.
Stop Debugger
Stops debugging the application or component and closes the Debugger window
You can use these buttons to move through your application—stopping when you want to examine the values of expressions or variables, to look at the call stack or event queue, or to perform other debugging activities. These buttons are described in greater detail in the following sections.
Step Button
Click the Step button when you want to step through the code one statement at a time. Typically, each time you click Step, the system executes a single statement. The behavior may vary, however, in certain contexts.
As you step through a statement block or event block, the Debugger stops on the end statement that closes the block. This enables you to examine the results of the operations performed in the statement or event block.
When you step out of an event block, control returns to the application until another event occurs for which there is an event block. At this point, you may need to interact with the application to cause an event to happen. However, having stepped out of an event block, the Debugger stops at the first statement of the next block to be executed.
If you step into a statement that opens a pop-up dialog, the application has control until you close the pop-up.
If the next statement calls a frame or procedure, the Step button steps across the call; that is, the application receives control until the call completes. Control returns to the statement immediately following the call. If an intervening break condition is encountered before the call completes, the Debugger gains control. When the call does complete, however, the Debugger stops execution at the statement following the call statement.
Finally, if the statement is a gotoframe statement, clicking Step moves you to the script for the frame invoked by the gotoframe statement.
Step Into Button
The Step Into button behaves like the Step button in all cases except the following:
When the next statement to be executed is a callframe statement.
The Step Into button moves you into the script for the frame and stops at the first statement in the initialize block. If the called frame has no initialize block, there is no statement to execute and you must click Step, Step Into, or Continue to display the frame and continue execution.
When the next statement is a callproc statement.
The Step Into button moves you to the script for the called procedure and stops at the first executable statement.
When the next statement invokes a method of a user class.
The Step Into button moves you into the script for the method and stops at the first executable statement.
When the next statement is openframe.
If a new thread is created, a new Debugger window is opened. The Debugger stops execution at the first statement of the initialize block of the new frame. If there is no initialize block, you must click Step, Step Into, or Continue to display the frame and continue execution.
There is an exception if the called frame, procedure, or method is in an included application, and the included application is in an image file. In this case, Step Into behaves like Step because no source is available. If the included application is in the database, however, the source is available.
Step To End Button
The Step To End button continues script execution until the next end, return, or resume statement in the current block or procedure.
If a break condition is encountered before reaching an end, return, or resume, the break will occur. If you continue execution after handling the break, the Debugger still takes control at an end, return, or resume as if the intervening break had not occurred.
Note:  The control of execution during the watch state is the same as when the application is running in a normal state except that the Step To End choice is not available. Control can be exercised by selecting Step, Step Into, or Continue while in the watch state of execution.
Continue Button
With two exceptions, the Continue button causes execution to continue until a break condition is encountered or until the application terminates.
One exception is when you have used the Step button, but a break occurs before reaching the statement following the statement where you issued the step command. In this case, if you click the Continue button, execution continues only until you reach the statement following the one where you stepped.
The other exception is when you have used the Step To End button, and a break occurs before reaching the next end, return, or resume in the procedure or block where you used the Step To End button. In this case, if you click Continue, execution continues only until you reach the first end, return, or resume statement in the block or procedure where you executed the Step To End command.