Article View: comp.lang.c
Article #219Re: Taming The Switch-Statement
From: Scott Lurndal
Date: Sun, 11 Oct 2026 15:29
Date: Sun, 11 Oct 2026 15:29
18 lines
2056 bytes
2056 bytes
bart <bc@freeuk.com> writes: >On 10/10/2026 21:33, Janis Papanagnou wrote: >> On 2026-10-10 22:03, Michael S wrote: >>> >>> The cases where I want to break out of the loop from the switch in the >>> body of the loop are very common. >> >> Ah, so you'd have needed something like Kornshell's 'break 2' to leave >> more than one level. - I suppose, you needed to used a 'goto' instead >> (and avoid the 'break' completely for those cases). >No, there is only one level of loop here. But you can't use 'break' >because it is doing double duty as a hack to get out of the middle of a >switch statement. > Burroughs BPL68 had EXITBLOCK, EXITCOND, EXITLOOP and EXITCASE as mechanisms to break from nested loops, conditionals and case (switch) statements.
Technical Details
Message-ID:
<nXNyS.252602$ITPb.192320@fx05.iad>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!news-out.netnews.com!s1-3.netnews.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx05.iad.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11ae8k3$2302a$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!news-out.netnews.com!s1-3.netnews.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx05.iad.POSTED!not-for-mail X-newsreader: xrn 9.03-beta-14-64bit Sender: scott@dragon.sl.home (Scott Lurndal) From: scott@slp53.sl.home (Scott Lurndal) Reply-To: slp53@pacbell.net Subject: Re: Taming The Switch-Statement Newsgroups: comp.lang.c References: <119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11ae8k3$2302a$1@dont-email.me> Lines: 18 Message-ID: <nXNyS.252602$ITPb.192320@fx05.iad> X-Complaints-To: abuse@usenetserver.com NNTP-Posting-Date: Sun, 11 Oct 2026 15:29:23 UTC Organization: UsenetServer - www.usenetserver.com Date: Sun, 11 Oct 2026 15:29:23 GMT X-Received-Bytes: 1732