is there {$IFDEF} in MetaEditor?

 

like topic, thanks

 

ifdef endif define , 3 keywords in C++ language. 

 
codeidea :

like topic, thanks

 

ifdef endif define , 3 keywords in C++ language. 

There's only #define, and this doesn't have the function call feature that is in C/C++. 

 

I can almost live without the #define function call which is mostly replaced by the inline function calls feature of C++ (I hope MQL5 inlines simple function calls?), although I would love to see an ASSERT() which is somehow compiled out of existence for release builds.  ASSERT() enables the writing of self-debugging code.

 

I'd really like to see #ifdef, #else, #ifndef and #endif, which could be used for things like #ifdef _DEBUG (like Microsoft Visual C++) which would allow extensive debug code to be written without impacting the performance of a release build.  I don't think introducing these would greatly add to the complexity of the code preprocessor.

 
We will add a constant "IS_DEBUG_MODE" which accepts value 1 if compilation for debugging and 0 if not


At compilation in RELEASE the optimizer will cut IF with constant condition IS_DEBUG_MODE (which will be 0)

 
mql5 :
We will add a constant "IS_DEBUG_MODE" which accepts value 1 if compilation for debugging and 0 if not

At compilation in RELEASE the optimizer will cut IF with constant condition IS_DEBUG_MODE (which will be 0)

 

Thanks very much.  I think this will be sufficient.

 

So from what you are saying, I'll try something similar to a Visual C++ style ...

 

ASSERT(Must_Be_Greater_Than_Zero>0);

 

as ....

 

#define DEBUG_ALERT Alert("Debug_alert_",__FUNCTION__,"_",__FILE__,"_",__LINE__) 

 

if (IS_DEBUG_MODE) if (Must_Be_Greater_Than_Zero<=0) DEBUG_ALERT;