Great! With such a simple task, so many different solutions! Thank you.
Sincerely, Vladimir.
Now it would be more correct to follow logic rather than practice syntax. Logic suggests that the result of the question "will or will not learn the language" can only return a function that calculates some parameters associated with this. Since the function must return yes/no result, it is declared with type bool. You can call the function directly from the if() condition.
if(Enough_time() && Enough_patience()) Print("I will learn the language!");
Реter Konow: Alas, this is a misleading, leading you down an unknown road of learning. What does "state" and this enumeration have to do with it? It's a fiction on a level playing field.
Now it would be more correct to follow logic rather than practise syntax. Logic suggests that the result of the question "will or will not learn the language" can only be returned by a function that calculates some parameters related to it. Since the function must return yes/no result, it is declared with type bool. The function can be called directly from the if() condition.
if(Enough_time() && Enough_patience()) Print("I will learn the language!");
else Print("Alas, I won't learn the language...");
Now, think about the content of the functions.
You're picking on me, of course the comment is incomplete there, the first variableinA is as it should be, a condition of execution so to speak, and the seconda, is as it is in fact)))))))))) And that's why inA is entered via an instance, and is immutable, and the variable a .... although yes, it shouldn't be a constant variable, but a static or just a text type))))
В качестве первого операнда – "выражение1" – может быть использовано любое выражение, результатом которого является значение типа bool. Если результат равен , то выполняется третий операнд – "выражениеЗ". Второй и третий операнды, то есть "выражение2" и "выражениеЗ", должны возвращать значения одного типа и не должны иметь тип void. Результатом...
Реter Konow: Alas, this is a wrong way of learning which leads you nowhere. What has "state" and this enumeration got to do with it? It is a fiction on a level playing field.
Now it would be more correct to follow logic rather than practise syntax. Logic suggests that the result of the question "will or will not learn the language" can only be returned by a function that calculates some parameters related to it. Since the function must return yes/no result, it is declared with type bool. You can call the function directly from the if() condition.
if(Enough_time() && Enough_patience()) Print("I will learn the language!");
else Print("I won't learn the language...");
Now, think about the content of the functions.
Hello, Peter! I certainly will! It's just that the question was asked:
"...The control question: 'enough time' - what type can this variable be without a compiler warning...".
That's what I was trying to answer. Thank you especially for your example!
you are picking on me, of course the comment is incomplete, the first variableinA is as it should be, a condition of execution so to speak, and the seconda, is as it actually is)))))))))) And that's why inA is entered via an instance, and is unchangeable, and the variable a .... although yes, it shouldn't be a constant variable, but a static or just a text type))))
But it still makes sense)
OK, I may be picking on you, but still, enumerations are superfluous for a student right now. You have to remember about consistency in the curriculum. Then let's write the class at once. ))))
Реter Konow: OK, I may be picking on you, but still, enumerations are unnecessary for a student right now. You have to remember about consistency in the curriculum. Then let's write the class at once. ))))
Hello, Peter! I'll certainly think about it! Only the whole point is that the question was asked:
"...The control question: 'enough time' - what type can this variable be, so that there are no compiler warnings...".
That's what I was trying to answer.
Sincerely, Vladimir.
Yes, hello. That's right, that was exactly the question but you haven't answered it correctly yet because the string type, in the context of the condition's contents, is incorrect. The compiler will not generate an error message or warning but the condition is defective in its meaning.
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.
UPD:
I don't like strings, luckily MQL allows explanations of input variables and sets to be created as a comment, it's better that way:
UPD:
don't like strings, good thing MQL allows explanations of input variables and sets to be created as a comment, better that way:
Cool! With such a simple task, so many different solutions! Thank you.
Regards, Vladimir.
Great! With such a simple task, so many different solutions! Thank you.
Sincerely, Vladimir.
Alas, this is a misleading, leading you down an unknown road of learning. What does "state" and this enumeration have to do with it? It's a fiction on a level playing field.
You're picking on me, of course the comment is incomplete there, the first variableinA is as it should be, a condition of execution so to speak, and the seconda, is as it is in fact)))))))))) And that's why inA is entered via an instance, and is immutable, and the variable a .... although yes, it shouldn't be a constant variable, but a static or just a text type))))
But it still makes sense)
Great! With such a simple task, so many different solutions! Thank you.
Regards, Vladimir.
And there are more patterns...
Yep, there is a ternary operator, too.)
From this path (understanding and knowing how to write it) starts, in fact, the developer's way. IMHO
Alas, this is a wrong way of learning which leads you nowhere. What has "state" and this enumeration got to do with it? It is a fiction on a level playing field.
Hello, Peter! I certainly will! It's just that the question was asked:
"...The control question: 'enough time' - what type can this variable be without a compiler warning...".
That's what I was trying to answer. Thank you especially for your example!
Best regards, Vladimir.
you are picking on me, of course the comment is incomplete, the first variableinA is as it should be, a condition of execution so to speak, and the seconda, is as it actually is)))))))))) And that's why inA is entered via an instance, and is unchangeable, and the variable a .... although yes, it shouldn't be a constant variable, but a static or just a text type))))
But it still makes sense)
OK, I may be picking on you, but still, enumerations are unnecessary for a student right now. You have to remember about consistency in the curriculum. Then let's write the class at once. ))))
No, no, no, no!!! I'm already a mess in my head!
Respectfully, Vladimir.
Hello, Peter! I'll certainly think about it! Only the whole point is that the question was asked:
"...The control question: 'enough time' - what type can this variable be, so that there are no compiler warnings...".
That's what I was trying to answer.
Sincerely, Vladimir.
No, no, no, no!!! I'm already messed up in the head!
Respectfully, Vladimir.