How to reference variable in Message Box?

To add comments, please log in or register
Government
14
Government  
To be more precise:

int a= 5;

int b=3;

int c=a+b;

MessageBox("The result of a+b is", <how to reference c?>, "Title");

So i need a way to reference result c i tried following:

int a= 5;

int b=3;

int c=a+b;

MessageBox("The result of a+b is", + (c), "Title");
But when i put script in a chart nothing happens.

Thank you
Simon Gniadkowski
17660
Simon Gniadkowski  

Try this . . .

int a=5;

int b=3;

int c=a+b;

MessageBox(StringConcatenate("The result of a+b is ", c), "Title"); //  or  MessageBox("The result of a+b is " + c, "Title");

https://docs.mql4.com/strings/StringConcatenate https://docs.mql4.com/common/MessageBox

To add comments, please log in or register