Stepping Through Code

Setting a breakpoint in your code allows you to suspend execution. Once execution is suspended, it is often useful to "step" through the code one statement at a time, inspecting the state of the application as you proceed. IDL's stepping features allow you to do this without the need to set a breakpoint on each line.

You can use any of the following to control execution of your code. You can invoke these operations either by selecting an item from the Run menu or clicking a toolbar button in the The Debug View. Some operations also have keyboard shortcuts or executive commands.

Resume

Menu

Run  Resume

Debug toolbar

tb_resume.gif

Keyboard

n/a

Executive command

.CONTINUE

Description

Resumes program execution.

Suspend

Menu

Run  Suspend

Debug toolbar

tb_suspend.gif

Keyboard

n/a

Executive command

n/a

Description

Temporarily halts program execution.

Terminate

Menu

Run  Terminate

Debug toolbar

tb_terminate.gif

Keyboard

Ctrl-F2

Executive command

n/a

Description

Terminates program execution, returning to the calling context. This option also issues the following commands:

RETALL 
WIDGET_CONTROL, /RESET 
CLOSE, /FORCE, /ALL 
HEAP_GC 

Step Into

Menu

Run  Step Into

Debug toolbar

tb_stepinto.gif

Keyboard

F5

Executive command

.STEP

Description

Executes the current statement.

If the current statement calls another routine written in IDL code, execution steps "into" the called routine and stops.

Step Over

Menu

Run  Step Over

Debug toolbar

tb_stepover.gif

Keyboard

F6

Executive command

.STEPOVER

Description

Executes the current statement.

If the current statement calls another routine written in IDL code, the entire called routine is executed before execution stops again.

Step Return

Menu

Run  Step Return

Debug toolbar

tb_stepreturn.gif

Keyboard

F7

Executive command

.RETURN

Description

Executes all statements until the end of the current routine. This has the effect of returning to the calling routine.

Skip Next Statement

Menu

Run  Skip

Debug toolbar

tb_skip.gif

Keyboard

Ctrl-Shift-F6

Executive command

.SKIP

Description

Skips the current line of code (does not execute it). This is useful for moving past a program statement that causes an error.

Run to Line

Menu

Run  Run to Line

Debug toolbar

n/a

Keyboard

Ctrl-R

Executive command

n/a

Description

Executes statements up to the statement on which the cursor is positioned in the editor.