Download MetaTrader 5

Problem with a code

To add comments, please log in or register
Marc
80
Marc  

Hi together,

I copied a code and modified it at several rows. When compiling it MT4 Editor shows an error. ErrorDescription is not defined:

           m_Allow_Trading = false;
           ErrorCode = GetLastError();
           string ErrorDescIniLongMod = ErrorDescription(ErrorCode);
           string ErrorAlertIniLongMod = StringConcatenate("OP_BUY-Initial-Modifiy does not work ", ErrorCode, " ", ErrorDescIniLongMod);
           Print(ErrorAlertIniLongMod); 
           Print("Handel gestoppt! - OP_BUY-Modifikation");
           return(0);
Marc
80
Marc  
nirvanamac:

Hi together,

the other code doesn't show an error when compiling:

        m_Allow_Trading = false;
           ErrorCode = GetLastError();
           string ErrorDescIniLongMod = ErrorDescription(ErrorCode);
           string ErrorAlertIniLongMod = StringConcatenate("OP_BUY-Initial-Modifiy does not work ", ErrorCode, " ", ErrorDescIniLongMod);
           Print(ErrorAlertIniLongMod); 
           Print("Handel gestoppt! - OP_BUY-Modifikation");
           return(0);
Marc
80
Marc  
I searched through some onlinemedia and/or handovers, manuals etc. but I can not find any error. Anybody there who can give me a hint?
Alain Verleyen
Moderator
34449
Alain Verleyen  

See documentation :

The GetLastError() function return codes. Error code constants defined at stderror.mqh file. To print text messages use ErrorDescription() function defined at stdlib.mqh file.

You need to add this line above your code :

#include <stdlib.mqh>
Marc
80
Marc  
angevoyageur:

See documentation :

You need to add this line above your code :


You are so right...omg sry for being so blind^^ thank you very very much
To add comments, please log in or register