Is there a way to dynamically name variables?
What I need to do is take a list of variable names from an input file and create variables with those names. Is this p
I would use some sort of keyed collection, like a hashtable, dictionary, or list of structures with the name. You can then refer to the variable by name:
var value = variableDictionary["MyVariableName"];
var value = variableHashtable["MyVariableName"];
var value = variableList.First(x=>x.Name == "MyVariableName");
There is no other way to dynamically "name" a variable.