A breakpoint interrupts the execution of a script. Although you can step through a script line by line, this can be tedious and lengthy for a long or complex script. You can set breakpoints at places of interest and simply run the script in the Debugger. The script is run normally until a breakpoint is reached. At the breakpoint, the Debugger stops executing the script so you can look at the values of variables or start stepping line by line.
Tip: Turn on line numbers by right-clicking in the script and selecting Show Line Numbers. You can also show line numbers by default in all scripts by modifying the Script Editor preferences.
•
|
•
|
In the Debugger margin, right-click the breakpoint icon and select Clear Breakpoint.
|
•
|
In the Debugger margin, right-click the breakpoint icon and select Enable Breakpoint or Disable Breakpoint.
|
Suppose that a calculation in your script is incorrect, and you suspect the problem occurs when i==19. Set a conditional breakpoint for i==18. The Debugger will run until that condition is met, then you can step through the code to identify the problem.
1.
|
Right-click the breakpoint icon and select Edit Breakpoint.
|
2.
|
On the Condition tab, select Condition and enter the conditional expression.
|
3.
|
4.
|
Click OK.
|
1.
|
Right-click the breakpoint icon and select Edit Breakpoint.
|
2.
|
On the Condition tab, deselect or select Condition.
|
Right-clicking the breakpoint and selecting Edit Breakpoint provides a quick way to manage breakpoint behavior. Alternatively, select the breakpoint on the Breakpoints tab and click . Both methods display the Breakpoint Information window, where you customize settings on the Hit Count and Action tabs.
You can control the number of times a breakpoint must be hit and when the break occurs. For example, to break when the condition is met twice, select break when the hit count is equal to and type 2 on the Hit Count tab.
You also have the option of defining a JSL expression or script that the Debugger executes when a breakpoint is hit and execution has stopped. This script is called an action. On the Action tab, enter the JSL expression to be executed.
When you right-click and select Run To Cursor, all expressions before the location of the cursor are executed. Select this option when you only want to see values up to the current line. To see values when each expression is executed, use the stepping options.