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:

To experiment with stepping, do the following:

  1. In the IDL Workbench, type
  2. .EDIT broken 
     

    at the IDL command prompt. This loads the file broken.pro into an editor window.

  3. Set a breakpoint in broken.pro by placing the cursor in the line that reads:
  4. PRINT, i*2 
     

    and selecting Toggle Breakpoint from the Run menu or simply double-clicking on the line. A blue breakpoint dot appears next to the line.

  5. Now enter the following to execute the program:
  6. BROKEN, 10 
     

    Execution stops at the specified line.

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