Allow me to post some sample code:
Ok, I'll just pause there for a second. Now, what I want, is to do something like "exampleClass.(valueof myString) = 1". myString contains the name of the class' variable exactly, and I'm wondering if there's a way to substitue it in.
Also, I know someone will suggest using "if (myString = "class1") exampleClass.class1 = 1". But this is NOT what I'm looking for.
Code:
class myClass
{
public:
bool class1;
bool class2;
};
void main()
{
string myString = "class1"
myClass exampleClass;
Ok, I'll just pause there for a second. Now, what I want, is to do something like "exampleClass.(valueof myString) = 1". myString contains the name of the class' variable exactly, and I'm wondering if there's a way to substitue it in.
Also, I know someone will suggest using "if (myString = "class1") exampleClass.class1 = 1". But this is NOT what I'm looking for.