Is it possible to create a Variable frome EA inside?

To add comments, please log in or register
Tim Rittel
266
Tim Rittel  

Hello...

i would like to know if it is possible to create a Variable from inside the EA...for Example


input string Nr1_Name="Hello";

input int PeriodChoosen=12;

// above all clear


// below is the question..is there a way to do this??

int MA_Period_"Nr1_Name"=PeriodChoosen;


(the Variable shall have the Name MA_Period_Hello in this Case...)

nicholi shen
2378
nicholi shen  
Tim Rittel:

Hello...

i would like to know if it is possible to create a Variable from inside the EA...for Example


input string Nr1_Name="Hello";

input int PeriodChoosen=12;

// above all clear


// below is the question..is there a way to do this??

int MA_Period_"Nr1_Name"=PeriodChoosen;


(the Variable shall have the Name MA_Period_Hello in this Case...)

Variables are only for the benefit of humans writing source code. If you find yourself wanting to dynamically create custom variables then that should be a giant clue that you need to use a collection; something like a list or dictionary. 

Tim Rittel
266
Tim Rittel  
nicholi shen:

Variables are only for the benefit of humans writing source code. If you find yourself wanting to dynamically create custom variables then that should be a giant clue that you need to use a collection; something like a list or dictionary. 

thank you Nicholi....

To add comments, please log in or register