Re: How can I define a label inside a switch?

2014-12-14 Thread ketmar via Digitalmars-d-learn
On Sun, 14 Dec 2014 18:24:39 + MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I used to do it in C but in D it's giving this compile error message: switch case fallthrough - 'use goto case;' if intended Here's the code: switch(value) { // alof of

Re: How can I define a label inside a switch?

2014-12-14 Thread MachineCode via Digitalmars-d-learn
On Sunday, 14 December 2014 at 18:27:28 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 14 Dec 2014 18:24:39 + MachineCode via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I used to do it in C but in D it's giving this compile error message: switch case fallthrough

Re: How can I define a label inside a switch?

2014-12-14 Thread Meta via Digitalmars-d-learn
On Sunday, 14 December 2014 at 18:41:54 UTC, MachineCode wrote: The labels are disabled then? I find that goto case case_value ugly and prefer goto labelName; but if it's the only way to go let's do it I'm not sure if it's intentionally not supported, or just an oversight. Probably the

Re: How can I define a label inside a switch?

2014-12-14 Thread ketmar via Digitalmars-d-learn
On Sun, 14 Dec 2014 18:48:15 + Meta via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Sunday, 14 December 2014 at 18:41:54 UTC, MachineCode wrote: The labels are disabled then? I find that goto case case_value ugly and prefer goto labelName; but if it's the only way to