Newsgroups: comp.os.msdos.djgpp From: manni DOT heumann AT gmx DOT de (Manni Heumann) Subject: Re: BREAKing out of a nested loop References: <005a01bffd43$030a3520$0500007b AT brk> X-Newsreader: News Xpress 2.01 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 03 Aug 2000 20:36:39 GMT NNTP-Posting-Host: ppp36-146.hrz.uni-bielefeld.de Message-ID: <3989d7e4_1@news.uni-bielefeld.de> X-Trace: 3 Aug 2000 22:36:52 +0200, ppp36-146.hrz.uni-bielefeld.de Lines: 34 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com djgpp AT delorie DOT com wrote: >>Try 'goto'. You'll love it. They never taught you about it in >>school. > >EEK! There are reasons for this! GoTo is "forbidden"! Nicer is to put this >into a function >that returns TRUE/FALSE. So, as soon as a collition is detected, you jump >out of the >function with false. This will break the loops. Might be considered cheating >but it >helps for making the code more usable so there is a good fix to this >problem. > Name just one of those reasons agains goto, other then "it looks like BASIC and real hardcore C coders don't use that kiddy stuff."! I didn't yet see one solution in this thread, that was as easy to read as a simple little goto. Checking a flag for every for, building the whole nest in a function and return? Picture yourself reading that code! Goto will also give you the benefit of feeling superior to the moron who still uses goto after all this years:-) Back to the beginning: Name one reason against using goto. At least name the law the forbids using goto. Come on, convince me! -- Manni Life would be much easier if I had the source code.