You are here: Automating Analyzer > Using the Procedure Editor > Using Step Mode and Breakpoints

Using Step Mode and Breakpoints

When testing or de-bugging your procedures, at times it may be helpful to run procedures in Step Mode (one line at a time) or to insert Breakpoints that pause the procedure at strategic points when encountered.

Once Step Mode and/or breakpoints are established, use either of the following right click options to run the open procedure in Step Mode:

Right-click and choose "Save and Run"
Right-click and choose "Run from Cursor" after positioning the cursor at the desired starting point.

Note: If the first command that is run after turning on Step Mode in your procedure is SET DEFAULT, then SET DEFAULT will turn off Step Mode as it resets the underlying command SET STEP ON to its default state of SET STEP OFF.

Step Mode

Use Step Mode to process an open procedure one line at a time. To use step mode:

1. Right-click and select Step Mode to set the procedure in step mode.
2. Alternatively, users can type SET STEP ON in the command line to activate Step Mode and SET STEP OFF to terminate Step Mode.
3. Once the procedure is run (as noted above) press F6 to advance one line at a time in the procedure. A yellow progress arrow appears on the next line to be executed.
As commands are run, Analyzer will switch focus to the Command Log whenever results are generated to the Log by a command. To return to the Procedure Editor, simply click the procedure tab.
Additionally, if your procedure calls another procedure, Analyzer will switch focus to the newly opened procedure tab and display the yellow progress arrow on the next line to be executed.
A Group command (and all commands within it and its outer End command) are treated as one command when in Step Mode. Pressing F6 will run the complete Group and advance the yellow progress arrow to the next line outside the Group.
4. Press F7 in step mode to terminate step mode and to run the remainder of the procedure (unless a breakpoint is encountered which will pause the procedure in step mode once again).

Note: When in step mode, the Status Bar changes to show Step Mode status and to remind users to use the F6 and F7 keys.

While running a procedure in step mode, any commands (e.g., Display Variables) can be issued from the menu or command line in the Command Log while the procedure is paused. This is especially useful when testing or debugging a procedure to assess the current state of variables and other output results. However, users should be very careful not to issue commands that will invalidate the remainder of the procedure (e.g., closing the open table).

Breakpoints

When running a procedure, users may only want to run a procedure to a certain point before pausing the procedure. This is especially true when developing and testing procedures and when you want to test only a specific section of a procedure.

Users can set one or more strategic breakpoints within a procedure.

To set a breakpoint, simply open the procedure in the Procedure Editor, place the cursor on the desired command, and then right-click and select Toggle Breakpoint. The breakpoint is added.

To remove a breakpoint, simply open the procedure in the Procedure Editor, place the cursor on the command with the breakpoint, and then right-click and select Toggle Breakpoint. The breakpoint is removed.

If more than one breakpoint has been set in a procedure, you can remove all breakpoints by simply opening the procedure in the Procedure Editor, and right-clicking and selecting Clear All Breakpoints. All breakpoints are removed.

Note: Breakpoints are maintained until manually removed or when the current Analyzer session is closed.

When a procedure is run that contains one or more breakpoints, the procedure is run until the breakpoint is encountered. The procedure is then paused and placed into Step Mode with the cursor placed at the breakpoint. The procedure may then be stepped through each remaining command using the F6 key, or taken out of Step Mode and run from the breakpoint using the F7 key.