- Errors, bugs, questions
- debug issues
- The cursor skip some lines in debugging mode
- MQL Plus Enhanced Debugging Support for MetaTrader 5
An (optional) include file to enhance debugging experience
MQL Plus Enhanced Error Handler Support for MetaTrader 5
An (optional) include file to enhance error code handling experience
- MQL Plus Enhanced Debugging Support for MetaTrader 5
An (optional) include file to enhance debugging experience
MQL Plus Enhanced Error Handler Support for MetaTrader 5
An (optional) include file to enhance error code handling experience
Ah yes, I see:
"Supports following features:
- Debug string comments
- VarDump variables and arrays
- Different assert types
- Trace
- Conditional Breakpoints
- Performance counters"
I had seen in before when I wasn't on the level to look into it yet. I will be doing that now.
You must be joking, not sure what I can contribute to that project. Your library is giving me headaches. Maybe I will try and error my way in there some day, but it didn't tell me much as is.
After that I tried to build a little class with Debug Break inside a function with a condition.
#include <Object.mqh> class CDebug : public CObject { private: int m_lvl; public: CDebug(); ~CDebug(); void Lvl(const int lvl) {m_lvl = lvl;} //here the internal m_lvl can be set int Lvl() {return(m_lvl);} //and issued bool Break(const int lvl); }; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ CDebug::CDebug() : m_lvl(0) { } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ CDebug::~CDebug() { } //+------------------------------------------------------------------+ bool CDebug::Break(const int lvl) { //It would have been written as Debug.Break(lvl); if(lvl > m_lvl) return(false); //Level is compared to the private m_level to see if we can enter the if(lvl <= m_lvl) { //breakpoint already. DebugBreak(); } return(true); } //+------------------------------------------------------------------+
Problem is as soon as the condition is met, the function is called and I end inside the class code, because the debug break is there, not in the program code that I would like to debug.
Then I tried this at the end of my code lines:
if(0>=debug_lvl)DebugBreak(); //debug_lvl is set to zero in the beginning and then increased. Problem was that Editor just ignored the condition and went straight for the Debug break.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use