Difference between these two sintaxis?

 

Hello all, I'm learning MQL4 and I'd like to know the difference between these three ways of coding:

//The idea is to combine a written message with a value

int A = 5;
int B = 10;

int C = A + B;

//Which one would be the best option?

Alert("5 + 10 is equal to " + C); //Option 1


Alert("5 + 10 is equal to ", C); //Option 2


Alert("5 + 10 is equal to " IntegerToString(C)); //Option 3

And, the SomethingToString is available to be used with wich operators? (DoubleToString, IntegerToString,...)


Best Regards,

Fernando.

 
FernandoBorea:

Hello all, I'm learning MQL4 and I'd like to know the difference between these three ways of coding:

And, the SomethingToString is available to be used with wich operators? (DoubleToString, IntegerToString,...)


Best Regards,

Fernando.

Option 3 is wrong code....

correct code is

Alert("5 + 10 is equal to ", IntegerToString(C)); //Option 3

else, all coding return same result

 
Eugenio Bravetti:

Option 3 is wrong code....

correct code is

else, all coding return same result

Thanks:) 

 
FernandoBorea:  I'm learning MQL4
Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
          General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon.
 
whroeder1:
Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
          General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon.

Chill out Willy

 
FernandoBorea:

Hello all, I'm learning MQL4 and I'd like to know the difference between these three ways of coding:

And, the SomethingToString is available to be used with wich operators? (DoubleToString, IntegerToString,...)


Best Regards,

Fernando.

Personally, I use StringFormat() for this sort of thing.

https://www.mql5.com/en/docs/convert/stringformat

Alert(StringFormat("5 + 10 is equal to %d", C);