Frohikki

Frohikki

  • NA
  • 10
  • 5.6k

Loop the switch

Sep 15 2012 5:44 PM
Hi 
I have a switch-statement and three case's. But now I need the switch to start over when it's done with case 2. Ive tried a while loop but it dosen't seems to help. Is there any other way?

 switch (row)//Färgalternativ
                {
                    while(true)
                    {
                    case 0:
                    Console.ForegroundColor = ConsoleColor.Yellow;
                    break;

                    case 1:
                    Console.ForegroundColor = ConsoleColor.Magenta;
                    break;

                    case 2:
                    Console.ForegroundColor = ConsoleColor.Green;
                    break;
                    }
                }

Answers (7)