Download MetaTrader 5
To add comments, please log in or register
Do you keep a blog? Place a link to MQL5.community there and make money!
Ernest Klokow
1069
Ernest Klokow 2014.04.06 10:14 

I want to create a string name e.g.

string name = A+B 

and then define a double variable with that string name e.g.

double name = x+y

Is that at all possible?

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.06 10:27  
it will say already declared...
Alain Verleyen
Moderator
28552
Alain Verleyen 2014.04.06 10:30  
ernest02:

I want to create a string name e.g.

and then define a double variable with that string name e.g.

Is that at all possible?

No it's not possible with mql4.
Carl Schreiber
5939
Carl Schreiber 2014.04.06 10:47  
ernest02:

I want to create a string name e.g.

and then define a double variable with that string name e.g.

Is that at all possible?


A work around:

1) Define a struct with value(s) and variable name(s).

2) Define an array of these structs.

3) If you need a specific var.-name search in the array for the name and get its value(s)

Gooly

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.06 11:01  

@ OP

I was thinking. Why making yourself hard when you can use other var names? Code smart not code hard.



Ernest Klokow
1069
Ernest Klokow 2014.04.06 14:39  

Thanks for the help and advice guys - especially that of Gooly.

Ernest

Carl Schreiber
5939
Carl Schreiber 2014.04.06 15:32  
ernest02:

Thanks for the help and advice guys - especially that of Gooly.

Ernest


You are welcome - good luck and lots of pips ;)

Gooly

/
To add comments, please log in or register