Debug versus Run

Scripts are executed in Debug mode by default. This enables a script writer to get feedback on their script while creating it, as well as allowing Debugging tools. An option to execute scripts in Run mode is also available. Using Run mode is faster than Debug mode since the script is executed on a single thread.

Debugging the Script

To debug your script, click the arrow next to the play button and select Debug. Then click the play button to start debug mode. Script execution stops the first time it reaches a breakpoint line. To continue, click the play button again to go to the next breakpoint line.

  • Step Into - The debugger executes the function call statement and then pauses execution at the first line of the function called.

  • Step Over - The debugger executes the function call and then pauses after the function returns.

  • Step Out - Only applies if execution is first stopped inside a function (by a breakpoint inside function or when Step In is activated). The debugger executes the rest of the function without pausing, and then returns to the line after the function call and pauses.

  • Breakpoints - You can left or middle click the grey column to the left of the line numbers to create a breakpoint, which is displayed by a red circle.

    When you click the play button in Debug mode, script execution stops the first time it reaches the breakpoint line. Clicking either button again forces it to run the breakpoint line and continue to the next breakpoint line.

    In Run mode, breakpoints do not work, and a red circle is displayed.

Note: Step Over and Step Into will work even if breakpoints are not defined.
Note: These options only apply to functions defined in the script, not native Discovery function calls.

Running the Script

To execute your script in Run mode, choose the dropdown arrow and select Run. Then click the icon again to run your script.