What you could do is have an extra variable to be your return value. In the switch, you can set the return value there, and then return after the switch.