Stepping Through a Program
Once execution halts at a breakpoint, you can step through the program manually, or continue execution automatically. When stepping through a main program, if the next line calls another IDL procedure or function, you have three options with which to handle execution of the nested program:
- Step Into executes statements in order by successive
.STEPcommands - Step Over executes statements to the end of the called function, without interactive capability
- Step Out to continue processing until the main program returns.
Note
While you can step through code in command-line mode using the .STEP, .STEPOVER and .RETURN executive commands, these operations are easier and more interactive when working within graphical mode. See Debugging Tools for further information.
To experiment with stepping, do the following:
- In the IDL Workbench, type
- Set a breakpoint in
broken.proby placing the cursor in the line that reads: - Now enter the following to execute the program:
- To step through the program, select Step Over from the Run menu, or press F6. Statements are executed one at a time. Alternately, select Resume from the Run menu or press F8 to let IDL continue until it hits another breakpoint, an error, or the end of the file.
PRINT, i*2and selecting Toggle Breakpoint from the Run menu or simply double-clicking on the line. A blue breakpoint dot appears next to the line.