Click here to Skip to main content
15,921,028 members
Home / Discussions / C#
   

C#

 
AnswerRe: How should I break a loop from within a case statement? [modified] Pin
Rob Graham22-Nov-06 5:53
Rob Graham22-Nov-06 5:53 
GeneralRe: How should I break a loop from within a case statement? Pin
Not Active22-Nov-06 5:59
mentorNot Active22-Nov-06 5:59 
GeneralRe: How should I break a loop from within a case statement? Pin
Judah Gabriel Himango22-Nov-06 5:59
sponsorJudah Gabriel Himango22-Nov-06 5:59 
GeneralRe: How should I break a loop from within a case statement? Pin
Oleg A.Lukin22-Nov-06 6:07
Oleg A.Lukin22-Nov-06 6:07 
GeneralRe: How should I break a loop from within a case statement? Pin
Judah Gabriel Himango22-Nov-06 6:29
sponsorJudah Gabriel Himango22-Nov-06 6:29 
GeneralRe: How should I break a loop from within a case statement? Pin
Oleg A.Lukin22-Nov-06 8:04
Oleg A.Lukin22-Nov-06 8:04 
GeneralRe: How should I break a loop from within a case statement? Pin
Ravi Bhavnani22-Nov-06 9:00
professionalRavi Bhavnani22-Nov-06 9:00 
AnswerRe: How should I break a loop from within a case statement? Pin
Judah Gabriel Himango22-Nov-06 5:56
sponsorJudah Gabriel Himango22-Nov-06 5:56 
Richard Hartness wrote:
ase statements are terminated with the C# keyword break. Unde


I guess you could have a boolean flag as part of the while loop, bool isBreakingFromDefault, and just set that flag to true when you break from default. When the while loop sees that flag as true, break from the while loop as well.

FWIW, I think the switch construct is butt ugly and often confusing. I'd much rather see a few if/elses.



Tech, life, family, faith: Give me a visit.
I'm currently blogging about: God-as-Judge, God-as-Forgiver
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


GeneralRe: How should I break a loop from within a case statement? Pin
Christian Graus22-Nov-06 8:50
protectorChristian Graus22-Nov-06 8:50 
GeneralRe: How should I break a loop from within a case statement? Pin
V.22-Nov-06 21:41
professionalV.22-Nov-06 21:41 
AnswerRe: How should I break a loop from within a case statement? Pin
ednrgc22-Nov-06 6:51
ednrgc22-Nov-06 6:51 
AnswerRe: How should I break a loop from within a case statement? Pin
CPallini22-Nov-06 7:07
mveCPallini22-Nov-06 7:07 
AnswerRe: How should I break a loop from within a case statement? Pin
Ravi Bhavnani22-Nov-06 8:58
professionalRavi Bhavnani22-Nov-06 8:58 
General[Message Deleted] Pin
R_L_H22-Nov-06 9:08
R_L_H22-Nov-06 9:08 
GeneralRe: How should I break a loop from within a case statement? Pin
Ravi Bhavnani22-Nov-06 9:24
professionalRavi Bhavnani22-Nov-06 9:24 
QuestionDataColumn.Caption not working Pin
Chals22-Nov-06 5:34
Chals22-Nov-06 5:34 
AnswerRe: DataColumn.Caption not working Pin
led mike22-Nov-06 5:46
led mike22-Nov-06 5:46 
AnswerRe: DataColumn.Caption not working Pin
ednrgc22-Nov-06 6:52
ednrgc22-Nov-06 6:52 
GeneralRe: DataColumn.Caption not working Pin
Chals22-Nov-06 21:22
Chals22-Nov-06 21:22 
GeneralRe: DataColumn.Caption not working Pin
ednrgc27-Nov-06 2:47
ednrgc27-Nov-06 2:47 
QuestionWindows application datagrid? [modified] Pin
Naji.A22-Nov-06 5:18
Naji.A22-Nov-06 5:18 
AnswerRe: Windows application datagrid? Pin
led mike22-Nov-06 5:45
led mike22-Nov-06 5:45 
AnswerRe: Windows application datagrid? Pin
meeram39522-Nov-06 19:56
meeram39522-Nov-06 19:56 
QuestionHow to create professional looking UI controls? Pin
Christian Krueger22-Nov-06 5:12
Christian Krueger22-Nov-06 5:12 
AnswerRe: How to create professional looking UI controls? Pin
led mike22-Nov-06 5:42
led mike22-Nov-06 5:42 

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.