Results 1 to 5 of 5

Thread: Switch Statement **SOLVED**

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    Resolved Switch Statement **SOLVED**

    Hey all,
    this is really emberassing

    I want to use a switch statement to check for some Integer values
    Code:
    switch (x)
    {
        case 0:
    		doSomething();
    		break;
        case 1:
        	doSomethingElse();
        default:
        	doNothing();
            break;
    }
    This is working. But is there a way that I can have more than one Integer inside my case Statement?
    Like
    Code:
    switch (x)
    {
        case 0,1,2:
    		doSomething();
    		break;
        case 2,3,4:
        	doSomethingElse();
        default:
        	doNothing();
            break;
    }
    Thanks for the help!

    Stephan
    Last edited by Sgt-Peppa; Aug 19th, 2005 at 07:22 AM. Reason: SOLVED
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width