1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Switch Case "goto"

Discussion in 'C#' started by shah123, Apr 4, 2007.

Thread Status:
Not open for further replies.
  1. shah123

    shah123 New Member

    Joined:
    Mar 27, 2007
    Messages:
    84
    Likes Received:
    0
    Trophy Points:
    0
    Hi If i have switch statement look like this and after getting or display function or by entering wrong character(default) how can i go to same screen which will display different options. As i know there are goto statements but that is not recommended? So please can anybody recommend me what to use or to do?
    Code:
    switch (s)
                {
                    case "g":
                    uname.getUserName();
                    break;
        
                    case "v":
                    uname.DisplayUserName();
                    break;
                   
                    default:
                    Console.WriteLine("Please select correct choice...");
    
    Thnx,
    Regards,
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    Duplicate of [thread=3746]Switch Case Options[/thread]. Thread closed.
     
Thread Status:
Not open for further replies.

Share This Page