Script Debugging

Enable script debugging

TSLab allows you to do real-time script debugging. It is very convenient. You can even change this value.

First, you need to enable debug mode in TSLab:

  1. Open the Program Settings,

  2. Go to the Script optimization tab, check the Script debugging checkbox.

  3. Click OK and restart TSLab.

Now run Visual Studio, open our script, in this case it is BuyScript from the previous example.

When TSLab launches the script for processing, it transfers control to the Execute method of our script. Therefore, we put a breakpoint immediately at the input of this method. Although the point can be set anywhere in the method, where we want the studio to stop the script process and give us control.

Now let's join the TSLab process. To do this, select Attach to Process ... (or Ctrl + Alt + P) from the Debug menu. In the search, type 'tslab' and select the TSLabApp64.exe process.

After that, the studio will join the TSLab process and now, if you go to TSLab and click execute, the studio will give us control at the chosen breakpoint.

In this mode, you can see the values of the current variables (Locals tab). In the Watch tab, you can write your own expressions or change the values of variables.

Shortcuts for debugging:

  • F10 - next step

  • F11 - next step with entering the method

  • Shift + F11 - exit the method to the next step

  • F5 - continue to the next breakpoint

  • Shift + F5 - stop debugging

Last updated