you see that each function returns false or -1 if it fails.
that's what you should use.
That's really right! I didn't even think of that... because there is an even better way, like me :) I can write complex functions that generate their own error codes.
The GetLastError() function is reset after reading its value. Insert an additional empty read before the operation you want.
That's the thing, I don't want to put a read before the required operation every time... I have all the operations I need, so I have to do GetLastError on the line:)
That's the thing: I don't want to put a read before the required operation every time... I have all the operations I need, so I have to do GetLastError on the line:)
Then it's not clear how you would like your new function to work. How it could update itself by time or any other signs?
I would like to read and write a special variable last_error. Handled the error, set to zero - not handled - the error code reaches the end of the program and is detected there.
OrderSend(...);
if (GetError()==конкретный номер){
// код обработки сброс ошибки или наоборот
SetError(0);
}
elseif(...)
...
...
// и в конце программыif (GetError()) >0){
// гдето необработанное исключение или ошибка номер...// просто сообщение об ошибке
}
No offence - this is also wrong.
It is the operation error that needs to be monitored: that is, what OrderSend (...) returns and only then, if necessary, call GetLastError().
That's right, it works as intended :) But no offense, I looked through your codes, I didn't find any call to GetLastError()... The first fly that flies through the window will destroy civilization :)
That's right, it works as intended :) But no offense, I looked through your codes, I didn't find any call to GetLastError() ... The first fly that flies through the window will destroy civilization :)
And look where I wrote about error handling - there are forum threads ;)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
No I write it this way:
in this case it's wrong too.
you see that each function returns false or -1 if it fails.
that's what you use.
I miss this function in MT4, what should I do?
The GetLastError() function is reset after you read its value. Insert an extra blank read before the operation you want.
in this case it's wrong too.
you see that each function returns false or -1 if it fails.
that's what you should use.
That's really right! I didn't even think of that... because there is an even better way, like me :) I can write complex functions that generate their own error codes.
The GetLastError() function is reset after reading its value. Insert an additional empty read before the operation you want.
That's the thing, I don't want to put a read before the required operation every time... I have all the operations I need, so I have to do GetLastError on the line:)
That's the thing: I don't want to put a read before the required operation every time... I have all the operations I need, so I have to do GetLastError on the line:)
Then it's not clear how you would like your new function to work. How it could update itself by time or any other signs?
No I write it this way:
No offence - this is also wrong.
It is the operation error that needs to be monitored: that is, what OrderSend (...) returns and only then, if necessary, call GetLastError().
That's right, it works as intended :) But no offense, I looked through your codes, I didn't find any call to GetLastError()... The first fly that flies through the window will destroy civilization :)
That's right, it works as intended :) But no offense, I looked through your codes, I didn't find any call to GetLastError() ... The first fly that flies through the window will destroy civilization :)