|
I should know better to get involved. This is partly a matter of taste, although in matters of style I'm always right.<g> Having been raised on the single exit point theory, I find the code sample with the leaves harder to read than the one without. For cases like this I think I'd use an indicator variable called "done" and set it in every exit situation. I'd probably use a character or numeric variable called something like leave_mode to contain the reason for ending the loop. This may just be a Pascal flashback, but my way, strangely enough, is more readable to me. <g> Dow NOT done; exfmt screen; select; when F3; done = *on; when cond1; leave_mode = cond1stuff(); done = *on; ........... enddo; //execute code that relies on leave_mode value -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Larry Sent: Monday, January 31, 2005 2:31 PM To: rpg400-l@xxxxxxxxxxxx Subject: Re: Suggested Technique Hi Martin, <snip> While I understand the idea of DO *hival coupled with a leave, why not just say it in the first place, and have a DOU F3 and avoid the extra lines of coding? DOU F3 is pretty clear, too, isn't it? </snip> I agree. But in the scenario where there are three different reasons why I would leave the screen loop, each also requiring a separate and distinct action, then I would rather couple the "action" and the "leave" to make it obvious to me. Examples: 1) DOU F3 or someFlag or someOtherFlag or yetAnotherFlag exfmt screen select ***************************** NOTICE: All e-mail sent to or from this e-mail address will be received or otherwise recorded by The Sharper Image corporate e-mail system and is subject to archival, monitoring, and review by and/or disclosure to Sharper Image security and other management. This message is intended only for the use of the addressee and may contain information that is privileged and confidential. The contents of this message may contain personal views which are not the views of The Sharper Image. If you are not the intended recipient, dissemination of this communication is prohibited. *****************************
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.