Engee documentation

Breakpoints of the script editor

Breakpoints when working with models are different from those used in the script editor.

Breakpoints script editor interactive script icon they allow you to pause code execution in the right place to analyze the program and search for errors. This feature is available for .ngscript and .jl scripts.

To add a breakpoint to a code cell, hover the cursor over the left corner of the code line. When the red dot appears, left-click on it to set a breakpoint.:

adding breakpoints

To delete, edit, or disable a breakpoint, right-click on the red placemark and select the appropriate option.:

delete breakpoints in code

The set breakpoint is displayed as a red dot in the left corner of the code line. When you create it, a list of all breakpoints automatically opens at the bottom of the editor.

adding breakpoints 1

If you right-click on the red dot, a menu will appear to select the type of breakpoint. There are three types available in total:

add breakpoints in code

And the three conditions necessary for breakpoints to work with conditions:

  • Expression — the breakpoint is triggered only if the specified expression is true.

  • Hit Count — is triggered only after a line of code has been executed a certain number of times.

  • Wait for Breakpoint — allows you to pause code execution until another breakpoint is reached.

Let’s take a closer look at what breakpoints there are and how they work with conditions.:

  • Breakpoint normal breakpoint — this is a basic breakpoint that stops program execution when the code reaches the specified line. This point does not use conditions.

  • Condition Breakpoint condition breakpoint — a breakpoint with a condition. It pauses the execution of the code only when the specified condition is met. For example, there is the following code:

    for i in 1:10
        println(i)
    end

    To add a breakpoint with a condition, right-click on the code line, then select Add Conditional Breakpoint. In the menu that appears, enter the condition in the Expression field i==5 and click Enter. The code will now stop when i It will become 5.

    create breakpoint 2create breakpoint 1

  • Triggered Breakpoint condition breakpoint — extended breakpoint with additional conditions. It stops execution only if another breakpoint has been activated. This is useful for complex debugging when code execution depends on other scenarios. For example:

    a = 0.5  # классическая Breakpoint
    b = 1.0  # Triggered Breakpoint, сработает после основной

    To add a point with additional conditions, right-click on the code line and select Add Triggered Breakpoint. In the menu that appears, select the breakpoint that will trigger before the Triggered Breakpoint and press Ok:

    create breakpoint 5

Changing the conditions will also change the type of breakpoint. So, the conditions Expression and Hit Count are used to create a Condition Breakpoint condition breakpoint, and Wait for Breakpoint for Triggered Breakpoint condition breakpoint accordingly.

To change the condition, right-click on the already created breakpoint and select the desired option.:

editing breakpoints

The system will display a notification when you try to disable breakpoints with conditions or messages.:

breakpoint warning 1