Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site ulysses.UUCP Path: utzoo!linus!decvax!harpo!eagle!mhuxt!mhuxi!mhuxa!ulysses!ggs From: ggs@ulysses.UUCP Newsgroups: net.lang.c Subject: Intelligibility of multibreak loops Message-ID: <573@ulysses.UUCP> Date: Thu, 25-Aug-83 10:44:02 EDT Article-I.D.: ulysses.573 Posted: Thu Aug 25 10:44:02 1983 Date-Received: Thu, 25-Aug-83 22:12:28 EDT Organization: Bell Labs, Murray Hill Lines: 44 I think 'chongo's example of how one can survive without the multi-level break is a demonstration of the need for it. Consider a slightly more complicated problem: you want to get the next line if the line is bad, you want to abandon the whole thing if the file is bad. If you use 'break label' and 'continue label', you get the following: /* read lines of text ... */ readloop: for (; some-code; some-code) { ... /* character in line processing */ while (some-code) { ... /* case in char in a line */ switch (some-code) { ... case BADLINE: ... continue readloop; /* get the next line */ break; ... case BADFILE: ... break readloop; /* stop reading */ ... } } } I don't even want to think about how to write that using convoluted flag testing, much less read it. -- Griff Smith Bell Labs, Murray Hill Phone: (201) 582-7736 Internet: ggs@ulysses.uucp UUCP: ulysses!ggs