|
A breakpoint designates an executable line of code where your script will pause if the path of execution reaches it. When a script pauses at a breakpoint, it pauses before executing the breakpointed line. You can create a breakpoint only in debug mode, but the breakpoint is not lost if you leave debug mode — it will still be there the next time you switch to debug mode. Breakpoints are saved when you save a compiled script in debug mode. They are lost when you save a compiled script in normal mode and close the script. Places where you can set a breakpoint are shown with diamonds in the gutter of the script window. To set a breakpoint:
To clear (remove) a breakpoint:
You can also leave all breakpoints in place but turn them off temporarily by choosing Script > Break on Breakpoints. If the menu item is unchecked, breakpoints are disabled. Encountering a breakpoint in the path of execution will not cause your script to pause. (If breakpoints appear to have mysteriously stopped working, check to make sure that Break on Breakpoints has not gotten unchecked!) Also, there is an optional toolbar icon you can add to the script window toolbar; the icon toggles its state to show whether we’re going to break on breakpoints or not. It is also possible to make a temporary breakpoint. A temporary breakpoint is a breakpoint which, when it is encountered, clears itself. Thus, we will pause there, but only once (because after that, the breakpoint will be gone). This is convenient, for example, to pause the first time through a loop but not on subsequent iterations. To set a temporary breakpoint, choose Script > Set Temporary Breakpoint. Alternatively, Option-click in an empty diamond. The diamond gets a little + sign in it.
In the above illustration:
The execute to here facility is a convenient way to combine setting a breakpoint with resuming execution.
|
||||||||||||||||||||||