Download MetaTrader 5

Problem with a code

To add comments, please log in or register
Marc
80
Marc 2013.12.11 12:08 

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 2013.12.11 12:10  
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 2013.12.11 12:12  
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
31134
Alain Verleyen 2013.12.11 12:12  

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 2013.12.11 13:36  
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