Self-learning the MQL5 language from scratch - page 24

 
Реter Konow:
What does "hidden condition" mean? This type of condition does not exist in programming.

Sorry Peter, didn't know about that, but the script works as I intended it to.

Regards, Vladimir.

 
MrBrooklin:

These were my comments on the script:

/* Moving on. After sending requests to the trade server, we need to know if
has set a pending order or not. To do this, let's use the OrderSend function which is designed for
trade operations by sending requests to the trade server. If sending a request to
fails (an exclamation mark in front of any function indicates a negative result of its execution
), then we output a message with an error code in the following format: "OrderSend error %d"
and GetLastError(). Let's understand what "OrderSend error %d" is and what GetLastError() is.
Note that "OrderSend error %d" is in double quotes. This means that
will print the text with the literal translation "OrderSend error %d". Now let's understand what
%d means. In the PrintFormat section of the MQL5 Reference, we find: "If a format string is followed by more parameters,
, this string must contain format specifications that define the format of outputting these parameters.
A format specification always starts with a percent sign (%)". What is a d? In the same section
just below we find: "Type d - specifies the minimum number of digits to be output. If the number of digits in
is less than the specified precision, the output value is padded with zeros on the left.
The output value is not truncated if the number of digits to be output is greater than the specified precision. With this
we have solved, now we need to understand what GetLastError() is. Again looking in the reference book: "GetLastError()
returns the content of the system variable _LastError, i.e., the variable in which
is stored the value of the last error that occurred during execution of the mql5 program.

Regards, Vladimir.

It's not clear at all. Why do double quotes make a literal translation from English into Russian? They will type OrderSend error %d into the Expert Advisor's log and instead of %d, substitute the value of the last error LastError returned by the GetLastError() function. Something like this))))

And in this case, d is not precision, but the type of signed decimal number)))

 
MrBrooklin:

Sorry Peter, didn't know about that, but the script works as I intended it to.

Regards, Vladimir.

Try removing the conditions and check. They don't do anything there.

 
Реter Konow:
Try removing the conditions and check. They don't do anything there.

It's a code stash)))

 
Valeriy Yastremskiy:

It's a code stash)))

Aaah)) 2 stashes.
 
Valeriy Yastremskiy:

It doesn't make any sense at all. Why would double quotes make a literal translation from English into Russian? They would type OrderSend error %d into the expert log , and instead of %d, they would substitute the LastError () value returned by the GetLastError() function. Something like this))))

And in this case, d is not a precision, but the type of signed decimal number)))

Not double quotes will make literal translation, and literal translation of that text, which is written in double quotes will sound in Russian Order Shipping Error %d.

Regarding the d - I agree, a mistake came out. Will change in the comments. Thanks for the tip.

Sincerely, Vladimir.

 
MrBrooklin:

Not the double quotes will make a literal translation, but the literal translation of the text that is written in double quotes will sound in Russian Order Shipping Error %d.

Regarding the d - I agree, a mistake came out. Will change in the comments. Thanks for the tip.

Sincerely, Vladimir.

Order is an order here. Well, I mean on the stock exchange) Do not copy the reference. It is evil. Write explanations in your own language. The cost of labour will increase many times over)

 
Valeriy Yastremskiy:

An order is an order here. I mean on the stock exchange) Don't copy the reference. It's evil. Write explanations in your own language. The cost of labor will increase many times over)

This is how Google Translate translated it. I will correct it. I'm not very good at English myself. The last time I studied English words was at the institute.

With respect, Vladimir.

 
MrBrooklin:

Not the double quotes will make a literal translation, but the literal translation of the text that is written in double quotes will sound in Russian Order Shipping Error %d.

Regarding the d - I agree, a mistake came out. Will change in the comments. Thanks for the tip.

Sincerely, Vladimir.

So you learn by translating from English? Hardcore, though.) Why not Kovalev's textbook? Although, I understand that it is designed for MQL4.

Still, you could start with it and then move on to the English part of the course.
 
Реter Konow:

So you learn by translating from English? Hardcore, though)) Why not use Kovalev's book? Although, I understand that it is designed for MQL4.

All the same, you could start with it and then move on to the English part of learning.

That's why the theme is called "... Zero in programming and zero in English.

Regards, Vladimir.