Again, I really dont think the respondents are reading the posts. I have either missed the line which is discussed or the Exit is only exiting a loop. This IS NOT the same as multiple exits from a procedure. It (Exiting loops) is shown and endorsed in many programming examples and languages from every 'language' vendor whose I have ever used. Having learned at least a few languages, over a few years, I have adopted the approach of adopting programmming 'styles' which appear (to me) to offer the clearest expression of the problem. In the most general sense, the single entry single exit sytle works. In MANY specific circumstances, it is just so much overhead. My Classic example of when the single exit is 'overhead' occured in the largest parse/find/replace program I ever personally wrote. I generally refered to the thing as not just finding the needle in the haystack, but finding the one (out of several hundred) with the correct serial number. I ended up with nothing except a huge number of nested select case statements, most with some type of loop in the innermost level. I chose to just Exit the procedure whe the correct needle was found and processed. Of course, I COULD have done the "Style" thinggy. Set a flag (or two), Exit the loop, Check the flag, find that I was done, do the 'goto xxx" and exit from that point. But that was four of five steps, tracing through several pages of code to achieve a "one liner". NO Contest.
Long away and far ago, back in the days of Guru's like "Yourdon", the world of software adopted the battle cry of "Structure". Structured Design. Structured Programming. Structured Walk Throughs. Structured Structures. Like every 'new' approach to software, it has some (actually in this case many) good concepts to make dealing with code much easier. It also included some 'nice' ideas whose use were more academic than totally necessary or even pratical. One-In / One-Out is, for me, in the latter category.
I worked at (the now defunct) Singer Corporation, where the PTB often hired the Guru's (a.k.a Yourdon) to help / teach these concepts, one which I rember VERY vividly was the concept that if the routine didn't fit on one page, it was to big and needed to be broken down into smaller units. Well this has come and gone. It is still recommended that routines which are 'Large" be broken down - but I do not ever here a requirements of "one page" or "50 lines" applied to a procedure. I place the one-in / one-out restriction in the same category.
MichaelRed
mred@att.net
There is never time to do it right but there is always time to do it over