Can Switch Case statements be outside the void loop?

while ('#') {

That's an infinite loop. '#' is non-zero, and will ALWAYS be non-zero.