Macro substitution (execute the content of variable)

 

Hello all

I'm not an advanced MQL4 coder and I would like to ask professionals here for opinions and help.
In the past I was using programming language where was one nice feature which I cannot find something similar in MQL4 or in C. It was called "macro substitution" and it has ability to execute the content of variable.
Usage was to add "ampersand" as a prefix to the variable.

For example:



string sMsg = "Hello world";      // the string
string sCommand = "Print(sMsg);"  // the command to print the string stored in variable sMsg
&sCommand;                        // executes Print(sMsg)


Is there something similar in MQL4 or C or some way to achieve this?

Thank you in advance.


 
antovski: Is there something similar in MQL4 or C or some way to achieve this?

No - it doesn't exist in MQLx, or C, or C++, or Fortran, etc. Print(sMsg); is all there is.

 
Hi William

Thx for reply. Btw, I was asking only for MQL/C, I dont need other languages and Print command was only example, there can be used any command.

Regards