The NXC guide has this statement "NXC also supports using string types in the switch expression and constant strings in case labels." However, I get "Error: Math Factor expected" when I used it that way:
I'm not sure what is going on in your case but your code compiles fine for me. Can you remind me what platform you are running on and what the version is of the IDE or compiler you are using?
Platform = Windows XP SP3
BricxCC = 3.3.8.10
Compiler options: Use internal compiler; Enhanced firmware; NXT 2.0 compatible firmware; Automatic firmware version; Opt level 2
Fudge! It now compiles for me. There must have been something in the section of code above the switch statement that confused it. (I've made severe changes immediately above the switch.)