How to add values of double variable to string variable
-
In my "Buy now" block, please look at the comment.
I want it to to appear as " Long Trade 1"
Instead it appears as "Long Trade c::Group"Please help

-
try if this is working:

-
I have been trying to add a string and a variable to a third variable to use in a Log Message.
The above example looks plausible but I cannot get it to work. It does display the variable value but omits the text element.
Should this work ?
As a workaround I have used someone else idea of a custom code block with Output_Variable = "Text " + (string)Input_Variable;
-
Don't use this c:: prefix, this is something from the EA and I might change this in future. In the blocks write just the name of the Constant, just Group.
Try this: "" + "Long Trade " + Group + ""
When you add "" + in the beginning and + "" at the end, this basically "opens" the input field to MQL code, otherwise everything you write is a string. Why that works? To be honest, it was never my intention, long time ago I just found that it works somehow and I think I will never change it, but who knows.
-
I have tried your suggestion and every other combination I can think of but keep getting error message "Undeclared identifier" with reference to whatever constant I use.
I am entering the test in the input field of a Log Message block. Am I missing something ? Many thanks.
-
Please disregard my last post.
For the avoidance of doubt adding ""+ at the beginning & + "" at the end works a treat.
Many thanks