Click here to Skip to main content
15,889,200 members
Home / Discussions / C#
   

C#

 
QuestionRead a Webpage content. Pin
AksharRoop7-Jan-09 4:13
AksharRoop7-Jan-09 4:13 
AnswerRe: Read a Webpage content. Pin
Colin Angus Mackay7-Jan-09 5:55
Colin Angus Mackay7-Jan-09 5:55 
GeneralRe: Read a Webpage content. Pin
AksharRoop7-Jan-09 19:57
AksharRoop7-Jan-09 19:57 
GeneralRe: Read a Webpage content. Pin
Colin Angus Mackay7-Jan-09 21:37
Colin Angus Mackay7-Jan-09 21:37 
QuestionRe: Read a Webpage content. Pin
AksharRoop7-Jan-09 23:25
AksharRoop7-Jan-09 23:25 
QuestionWhen is goto acceptable? Pin
Dewald7-Jan-09 4:05
Dewald7-Jan-09 4:05 
AnswerRe: When is goto acceptable? Pin
Alan Balkany7-Jan-09 4:15
Alan Balkany7-Jan-09 4:15 
AnswerRe: When is goto acceptable? Pin
Jon Rista7-Jan-09 4:18
Jon Rista7-Jan-09 4:18 
switch
{
    case a: 
       // do something for a
       break;
    case b:
       // do something for b
       goto default;
    case c:
       // do something for c
       break;
    default:
       // do default/common stuff
       break;
}

while (someConditionA)
{
    while (someConditionB)
    {
        foreach (something in other)
        {
            // do stuff with something

            if (exit condition)
                goto Label_ExitLoops;
        }
    }
}

Label_ExitLoops:
// continue on exit here


Only two situations I ever use it for. Deeply nested loops could be exited with a series of flags, but I think the goto is a lot cleaner and more efficient.
AnswerRe: When is goto acceptable? PinPopular
#realJSOP7-Jan-09 4:40
mve#realJSOP7-Jan-09 4:40 
JokeRe: When is goto acceptable? Pin
Giorgi Dalakishvili7-Jan-09 5:05
mentorGiorgi Dalakishvili7-Jan-09 5:05 
AnswerRe: When is goto acceptable? Pin
Wendelius7-Jan-09 5:05
mentorWendelius7-Jan-09 5:05 
GeneralRe: When is goto acceptable? PinPopular
DaveyM697-Jan-09 5:16
professionalDaveyM697-Jan-09 5:16 
GeneralRe: When is goto acceptable? Pin
Wendelius7-Jan-09 5:21
mentorWendelius7-Jan-09 5:21 
GeneralRe: When is goto acceptable? Pin
CPallini7-Jan-09 6:12
mveCPallini7-Jan-09 6:12 
JokeRe: When is goto acceptable? Pin
Luc Pattyn7-Jan-09 6:34
sitebuilderLuc Pattyn7-Jan-09 6:34 
AnswerRe: When is goto acceptable? Pin
Guffa7-Jan-09 5:17
Guffa7-Jan-09 5:17 
AnswerRe: When is goto acceptable? Pin
Dan Neely7-Jan-09 5:29
Dan Neely7-Jan-09 5:29 
GeneralRe: When is goto acceptable? Pin
Luc Pattyn7-Jan-09 6:32
sitebuilderLuc Pattyn7-Jan-09 6:32 
GeneralRe: When is goto acceptable? Pin
DaveyM697-Jan-09 7:14
professionalDaveyM697-Jan-09 7:14 
GeneralRe: When is goto acceptable? Pin
Luc Pattyn7-Jan-09 7:26
sitebuilderLuc Pattyn7-Jan-09 7:26 
GeneralRe: When is goto acceptable? Pin
DaveyM697-Jan-09 7:46
professionalDaveyM697-Jan-09 7:46 
AnswerRe: When is goto acceptable? Pin
CPallini7-Jan-09 6:17
mveCPallini7-Jan-09 6:17 
AnswerRe: When is goto acceptable? Pin
Dave Kreskowiak7-Jan-09 6:20
mveDave Kreskowiak7-Jan-09 6:20 
JokeRe: When is goto acceptable? Pin
Guffa7-Jan-09 6:24
Guffa7-Jan-09 6:24 
QuestionCreating Interops Pin
satsumatable7-Jan-09 3:28
satsumatable7-Jan-09 3:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.