Debug Mode in Action on a Sample ScriptThis article shows how to debug a sample script.
The script launches notepad, and in a loop types Hello concatenated with the index i. A second index j is there only for the tutorial purpose.
The easiest way to use Debug mode is to put the cursor just before the line where the execution must stop and then watch the variable i. So you put the cursor in front of line 8 and you press F8, keyboard shortcut for Run to cursor (or in the Debug toolbar, you can click the Run to cursor icon or select Debug/Run to cursor menu). The Editor window with the cursor on line 8 looks like:
And after pressing F8, the Editor window is minimized, notepad is launched, Hello1 is typed in notepad, the script stops and the Editor window comes back to focus. Note the green arrow pointing the line where the script stopped (the pointed line is not yet executed).
Before executing line 8, you want to know the value of i. In the Output pane (the one in the bottom), click Watch Tab if it is not on focus, and click Add new variable:
And in <name>, type the name of the variable to watch, so i and press Enter. The value of the variable i is displayed:
The script stops just before executing line 9:
If you want to stop the execution in Debug mode, press Shift+F5 (or click the Stop debugging icon in the Debug toolbar or select Debug/Stop debugging menu option).
Note that as soon as you close the Editor, all the Debug environment is lost (breakpoints and Watch variables). And the Watch variables list is shared with all the opened scripts within the Editor window.