Can I invoke a macro with a string parameter in the form a+b+c ?
#define __Log__(_msg) Print("<session_id>\t",_msg)
great lippmaje tanks again, It do a great job also with Filewrite :
#define __Log__(msg_log_level, msg) if(msg_log_level<=Log::log_level){ \ if(Log::journal) Print(EnumToString(msg_log_level),"\t",msg); \ if(Log::fh!=INVALID_HANDLE) \ FileWrite(Log::fh,TimeToString(TimeCurrent(),TIME_DATE|TIME_SECONDS)+"\t"+_Symbol+"\t"+msg);}
lippmaje
- www.mql5.com
How to display the error text of a runtime error, MQL 4/5 compliant: #ifdef __MQL5__ #include #else #include #endif int OnInit () { ResetLastError (); // do something that might set an error if ( _LastError ) { Print ( "error: " , _LastError , " " ,ErrorDescription( _LastError )); // error: 4802 Indicator cannot be...
Good. Suggestion:
#define __Log__(msg_log_level, msg) Log::LogMsg(msg_log_level, __FUNCTION__, msg) #define __Log1__(msg) __Log__(1, msg) #define __Log2__(msg) __Log__(2, msg) static void Log::LogMsg(int level, string func, string msg) { if(level<=Log::log_level) { if(Log::journal) Print(EnumToString(level),"\t",func,"\t",msg); if(Log::fh!=INVALID_HANDLE) FileWrite(Log::fh,TimeToString(TimeCurrent(),TIME_DATE|TIME_SECONDS)+"\t"+_Symbol+"\t"+func+"\t"+msg); } }
Hello, here it's hard to understand for me why the compiler generate this error and how I can fix it:
many thanks to everyone who will help!