The cases in a switch statement must be constants and not variables. If you want to use variables you have to use an if-elseif block.