Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.8 $; site ndm20 Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!convex!ndm20!tp From: tp@ndm20 Newsgroups: net.lang.c Subject: Re: C style Message-ID: <3400010@ndm20> Date: Mon, 23-Sep-85 20:05:00 EDT Article-I.D.: ndm20.3400010 Posted: Mon Sep 23 20:05:00 1985 Date-Received: Sun, 29-Sep-85 04:45:33 EDT References: <1556@brl-tgr.ARPA> Lines: 32 Nf-ID: #R:brl-tgr.ARPA:-155600:ndm20:3400010:000:1263 Nf-From: ndm20!tp Sep 23 19:05:00 1985 >How about this version >/* input characters until either "E" or a number between 1 and 5 is input */ > for (;;) { > ch=getch(); > if ((ch>='1'&&ch<='5')||ch=='E') break; > putchar(BELL); > } > addch(ch); > refresh(); Some of us feel the same about breaks as we do about gotos. I won't use it, or continue either, and I won't let anyone in my shop use it. It is just a goto with an implicit label, and destroys the ability to determine program flow from the FORM of the source even more drastically, as there is no label to catch your eye and alert you to the presence of the d*mned thing. The only way I will use a break is in a set of macros implementing a middle exit loop construct. We use LOOP...LOOPUNTIL...ENDLOOP. I know, adding features to a language with #define has problems, but at least that code is readable once you know what the constructs do, which is quite apparent. C should have that structure built in. Since it doesn't, we add it. The keywords are at the same indentation level, of course. Thanks, Terry Poot Nathan D. Maier Consulting Engineers (214)739-4741 Usenet: ...!{allegra|ihnp4}!convex!smu!ndm20!tp CSNET: ndm20!tp@smu ARPA: ndm20!tp%smu@csnet-relay.ARPA (-: Someone challenged me to produce flames. This should do it :-)