Files
mql5-skills/skills/mql5/references/docs/04-common/0223-common-debugbreak.md
T
2026-06-23 21:47:51 +08:00

36 lines
861 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# DebugBreak
It is a program breakpoint in debugging.
```
void  DebugBreak();
```
Return Value
No return value.
Note
Execution of an MQL5 program is interrupted only if a program is started in a debugging mode. The function can be used for viewing values of variables and/or for further step-by-step execution.
Example:
```
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- compile the file using F5
//--- in debugging mode, if i == j, stop at the DebugBreak() string  
   for(int i=0,j=20; i<20; i++,j--)
     {
      if(i==j)
         DebugBreak();
     }
  }
```