Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1416
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks for the clarification.
By the way, I removed the yellow pluses and the compiler gave an error. So they play some role in this whole construction. But what.... I still don't understand. What for they are needed when string addition is performed only through the use of blue pluses. Judging by your explanations, there is nothing else in this construction ..... if I'm not mistaken.
And about string(i)... About the type conversion .... is more or less clear to me. What is not clear is that..... string is the name of a variable type. i is a counter variable denoting the index of an array element. And why isi in parentheses () ? I've been thinking so far that parentheses are a function characteristic. For example, Print( ). And different data are put inside parentheses in some functions. But what do parentheses mean or what function do parentheses perform with respect to i and this whole construct - string(i)? At first glance, it seems that before the i variable had an int type (integer), and then you changed the i variable's type from int to string (string) . But round brackets containing i do not let me think so.
Thanks for the explanation.
This is not a type conversion, but a conversion of a value in the i variable
You can often see it this way
This is not a type conversion, but a transformation of the value found in the variable i
can more often be seen as
Thanks for the tip. Value conversion of the i variable. What do you mean in my code?
1. The value of i was 0, after(string)i+ it became 1, then 2 and so on up to 30. Why do I need (string) instead of justi++?
2. The type of the i variable was int, and after (string)i+ it became string? Well, this is not value conversion, but transformation of the variable type.
And also .... Maybe you can explain me what the yellow pluses add up to. Or what are they for?
Thanks for the explanation.
Thanks for the tip. Convert the value of variable i. What is meant in my code?
1. The value of i was 0, after(string)i+ it became 1, then 2 and so on up to 30. Why do I need (string) instead of justi++?
2. The type of the i variable was int, and after (string)i+ it became string? Well, this is not value conversion, but conversion of the variable type.
And also .... Maybe you can explain me what the yellow pluses add up to. Or what are they for?
Thanks for the explanation.
Type conversion or explicit type conversion are equal. The documentation uses both expressions. You correctly noted Alexey's caveat, it is type conversion that...
Further: We have several strings
The value of i is incremented in the loop at each iteration and gets into this string from there...
Note that pluses are put between these strings. These pluses add up these lines into one line. The result is the string "0: 1.6251," and then this string is appended to the string in the eStr variable by operator +=
Thanks for the tip. Convert the value of variable i. What is meant in my code?
1. The value of i was 0, after(string)i+ it became 1, then 2 and so on up to 30. Why do I need (string) instead of justi++?
2. The type of the i variable was int, and after (string)i+ it became string? Well, this is not value conversion, but conversion of the variable type.
And also .... Maybe you can explain me what the yellow pluses add up to. Or what are they for?
Thanks for the explanation.
With yellow pluses you form a string (text) which you output withPrint();
You can do the same with StringConcatenate()
You use the yellow plus sign to form a string (text), which you output withPrint();
You can do the same with StringConcatenate()
I do not advise to use this function as it works quite differently in MQL5 than in MQL4. Consequently, it may be hard to understand it when you switch to MQL5.
But maybe I'm wrong...
mql4
mql5
As you can see, in mql5, it is very similar to simple addition of strings.
And type conversion takes place in this function without any additional worries.I do not recommend to use this function because it works differently in MQL5 than in MQL4. Consequently, it may be hard to understand when you switch to MQL5
Thanks for the valuable information
You use the yellow plus sign to form a string (text), which you output withPrint();
You can do the same with StringConcatenate()
Thanks for the new information for me
Thank you for the valuable information
I have added to my hastily written message.
It's already clear to everyone how grateful you are to everyone who explains something to you. Don't stretch the topic with separate messages...
Next: We have several strings
Why can't 1.6251 be cast to the string type explicitly like i? It's shorter and saves computational resources..... it seems to me.
Thanks for the explanation
I have added to my post hastily written.
And it's already clear to everyone how grateful you are to everyone who explains something to you. Don't stretch the topic with separate messages...
Okay. Then a thank you for each of your replies will be implied by default( will be stored in a variable :):):) ).... if you don't mind.