Breakpoints of the script editor
| Breakpoints when working with models are different from those used in the script editor. |
Breakpoints script editor
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.:

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

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.

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:

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
— this is a basic breakpoint that stops program execution when the code reaches the specified line. This point does not use conditions. -
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) endTo 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==5and click Enter. The code will now stop wheniIt will become5.
→

-
Triggered 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:

Changing the conditions will also change the type of breakpoint. So, the conditions Expression and Hit Count are used to create a Condition Breakpoint , and Wait for Breakpoint for Triggered Breakpoint accordingly.
|
To change the condition, right-click on the already created breakpoint and select the desired option.:

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