Break statement in C#.
-
I would like to ask why break statements cannot have labels in C#? For instance;
label1: for(;;) { label2: for(;;) { label3: for(;;) { break label2; } } }
Kind Regards, Sarp Arda Coskun -- modified at 12:47 Thursday 8th December, 2005 -
As far as I know Java have this. And it could be beatiful to goto label2 directly for example. Not only a break to one outer loop. Sarp Arda Coskun
You could still use X|
goto
, but remember: For every goto you use, god kills a kitten! mav -
You could still use X|
goto
, but remember: For every goto you use, god kills a kitten! mavFor god's shake...i haven't used goto since : Amstrad 6-128 BASIC 1.1 Ready | Aaaaahh beautiful recollections of my childhood.
-
Perl does it and it makes sense to me. *shrug* --- Shawn Poulson spoulson@explodingcoder.com
-
I would like to ask why break statements cannot have labels in C#? For instance;
label1: for(;;) { label2: for(;;) { label3: for(;;) { break label2; } } }
Kind Regards, Sarp Arda Coskun -- modified at 12:47 Thursday 8th December, 2005C# is a post C++ and Java language, It took the good from both languages. using labels in code makes it unreadable, using labels is not a good idea. Thats y they got rid of so called labels. :) Work smarter, not harder -- modified at 16:55 Thursday 8th December, 2005
-
I would like to ask why break statements cannot have labels in C#? For instance;
label1: for(;;) { label2: for(;;) { label3: for(;;) { break label2; } } }
Kind Regards, Sarp Arda Coskun -- modified at 12:47 Thursday 8th December, 2005Man, what you're asking for is damn ugly. If Java has this, I'm glad I don't use Java. Christian Graus - Microsoft MVP - C++
-
C# is a post C++ and Java language, It took the good from both languages. using labels in code makes it unreadable, using labels is not a good idea. Thats y they got rid of so called labels. :) Work smarter, not harder -- modified at 16:55 Thursday 8th December, 2005
-
Man, what you're asking for is damn ugly. If Java has this, I'm glad I don't use Java. Christian Graus - Microsoft MVP - C++