When I came here 12 years ago, all the code was in RPG III. Every chain and
DO loop used *IN99 as the resulting indicator. Sometimes they would have
nested loops in which *IN99 was referenced within both of the loops.
Needless to say, when we finally started using RPG IV (and that was only
because one of the most critical programs we have ran into RPG III's 50-file
limit), I set about making it a practice to use only qualified BIFS. A
couple of extra seconds spent typing the qualifier is well spent,
considering the hours of frustration the next guy spends debugging the
application later if you don't. Time is money.

On Thu, Jul 3, 2008 at 7:15 AM, Aaron Bartell <aaronbartell@xxxxxxxxx>
wrote:

This all goes back to what Jon Paris said earlier in this thread. Your
approach is good and all until somebody other than you goes in to modify
the
code and starts separating out the chain from the %found (maybe even adding
some additional chains in-between). That's when those bugs come into play
that can take a day to resolve and at that point you have lost all you
thought you gained by not fully qualifying the %found/%eof.

Aaron Bartell
http://mowyourlawn.com

On Thu, Jul 3, 2008 at 4:15 AM, john e <jacobus1968@xxxxxxxxxxx> wrote:


I always try to create readable (or "self documenting") code and always
use
%eof instead of %eof(name), because IMO this is much more readable. It is
applying the priniciple of DRY (dont repeat yourself).
Unless, of course, the qualification is necessary. And this is an
exception.


chain (custno) CUSTFILE
if %found;
endif;

is much easier to read than:

chain (custno) CUSTFILE
if %found(CUSTFILE);
endif;

Because in the latter case each time you read the code you have to check
the qualification and if it really is referring to the last file
operation.
Although in most cases this is always the case. And reading/interpreting
the
unnecessary qualifier each time interferes with comprehending the code.

Also, when copying and pasting source you have to make sure you also
change
the corresponding qualifier. Always using a (unnecessary) qualifier makes
you repeat the filename and this is then another source of error.

--
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 thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.