I noticed that using a switch statement, the case always has to be a constant character or integer or it won't compile. It's sorta of a bummer as the only alternative is using a bunch of if/else if's.
So doing something like this won't work:
switch(aString)
{
case "word1": doSomething(); break;
case "word2": doSomething(); break;
case "word3": doSomething(); break;
}
or even something like this won't work.
switch(aString)
{
case strToNum("word1"): doSomething(); break;
case strToNum("word2"): doSomething(); break;
case strToNum("word3"): doSomething(); break;
}
So is there any intutive way of going around this? I think I found somewhere you can use enums but thats all I could find.