I'm not sure if this is possible at all or if I should use something else then const.
I have about 50 const strings, with all a unique value. The program will read a string which is one of the const names.
what I want:
private const string AllPlace1 = "1355,-203,-4,0.002551732,0.705572185,0.708626711,0.003092848,-1,0,0,0";
private const string MoveDown1 = "1355,-203,-24,0.002551735,0.705572183,0.708626713,0.00309285,-1,0,0,0";
private const string Free1 = "1355,-108,-24,0.002551719,0.705572218,0.708626678,0.003092837,-1,0,0,0";
When the string "AllPlace1"
is given the system should print out the value of const AllPlace1
.
of course, I can write something like this for all possibilities, but that is not what I want to do for 50 possible values.
if (args[3] == "AllPlace1")
WriteLine(AllPlace1);
else if (args[3] == "MoveDown1")
WriteLine(MoveDown1);
etc