Download MetaTrader 5
To add comments, please log in or register
Add our Twitter channel to friends and follow the news!
ffoorr
984
ffoorr 2015.03.23 09:43 

Does the last error remain in the  GetLastError() fonction until a new error come

Or does the   GetLastError() fonction is reset ?

Keith Watford
Moderator
7953
Keith Watford 2015.03.23 11:21  

Does the last error remain in the  GetLastError() fonction until a new error come

Yes 

Or does the   GetLastError() fonction is reset ?

No, unless you reset it with ResetLastError()

Usually , when calling a function, you can check the return value to see if there was an error or not. If there was an error call GetLastError() 

ffoorr
984
ffoorr 2015.03.23 15:01  
Thank's
honest_knave
966
honest_knave 2015.03.23 18:17  

From GetLastError():

"After the function call, the contents of _LastError are reset."

whroeder1
13620
whroeder1 2015.03.23 18:44  
honest_knave: From GetLastError():

"After the function call, the contents of _LastError are reset."

  1. And that used to be true before Build 600.
  2. Then the documentation said ResetLastError - MQL4 Documentation (29 Jul 2014)
    Note
    It should be noted that the GetLastError() function doesn't zero the _LastError variable. Usually the ResetLastError() function is called before calling a function, after which an error appearance is checked.
  3. And now it says
    Note
    The GetLastError() function  zero the _LastError variable.
/
To add comments, please log in or register