|
Bob, While I try to beat myself into submission and only have one exit point out of loops I'll admit that using RETURN in more than one place does have a certain appeal. And if used multiple times in the main procedure then I can see where *TERMSR would be beneficial. Would that be called regardless of the state of *INLR? Sometimes I even find myself wishing for a return option in a subprocedure that will not only exit the subprocedure but exit the program. Bet that really honks the structure police. Rob Berendt -- "All creatures will make merry... under pain of death." -Ming the Merciless (Flash Gordon) "Bob cozzi" <cozzi@xxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 01/13/2004 11:02 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc Fax to Subject RE: *INZSR - I still love you!!! Hans, While I don't necessarily use the RESET all that frequently, I have used it a few times and was very happy it was there. If I set the initial value of a field to something other than zero, I may want to do a RESET on that field during a re-running of my program. Think about all those date fields that have a questionable initial value by default, I can simply do a RESET and they're back to their original values. No more coding another entry in the subroutine (or proc) to set reset the initial value for a field. I declare it, set the INZ keyword, and I'm ready to go; I don't have to remember to add an assignment statement to some procedure or subroutine somewhere. I also think *INZSR is a great feature and wish dearly that a *TERMSR would have been implemented in RPG IV (I could still use it today, even more so.) Bob Cozzi Cozzi Consulting www.rpgiv.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Hans Boldt Sent: Tuesday, January 13, 2004 9:35 AM To: rpg400-l@xxxxxxxxxxxx Subject: Re: *INZSR - I still love you!!! DeLong, Eric wrote: > Rick, as I recall it, the real need for *INZSR came from the RESET opcode, > which depends on a step in the cycle where initialized storage is saved > before starting the main calcs. *INZSR lets you programatically initialize > storage before it is captured as "initialized". This lets you RESET complex > structures easily and quickly to their original initialized values. For > some reason, I've never seen RESET used much in the code I've maintained. > I'm not sure when or where I last told this story: I still remember the design meetings where this particular set of enhancements was discussed. At the time, I was busy working on the SAA RPG 370 compiler, but was occasionally invited to design meetings for the RPG III compiler on the 400. At this particular set of meetings, we were discussing what enhancements were needed in the area of initialization, such as initial values on I-Specs, named constants, CLEAR opcode, etc. I was arguing to keep things simple, but others wanted more and more functionality. I got fed up with that "creeping featurism" and suggested something I thought was totally ridiculous. Unfortunately, that backfired on me when the developer loved the idea, and I couldn't talk her out of it. That "ridiculous" idea was the RESET opcode. It took many releases before RESET worked properly, long after the original developer left IBM for a job in Redmond. Personally, I'd just as soon see explicit assignments instead of the RESET opcode. If something needs to be reset to some value in several places, then the initializations should go into a separate procedure or subroutine and called as needed. There's nothing magical about a separate RESET opcode, and the use of such an opcode can increase the resources needed for the program. Cheers! Hans _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.