× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



If this code has been in place so long, the following thoughts spring to my mind ...

1. The code is working successfully
2. Otherwise, and if there is no known bug that can emanate from it, then the code or its result is being ignored.
3. Otherwise there is a correcting mechanism elsewhere. So, to correct the "bug" here, may introduce a bug via the correcting mechanism, whatever that correcting mechanism maybe.
4. Is there any documentation available?
5. I would look at other code written by the same person or team at around the same time to try to understand their thinking and their style.
6. Re-evaluate what you will gain from changing this obtuse piece of code as opposed to the risk involved
7. TEST TEST TEESSSSSTTTTTTTT
8. and TEST AGAIN !!!!


Regards,
John McKay
www.mckaysoftware.ie
www.rpglanguage.com


----- Original Message ----- From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Tuesday, November 11, 2008 5:36 AM
Subject: Re: How do you read this code ?


Douglas Handy wrote:
While I agree Joe's observation means his simple one-liner performs the
equivalent function of the existing code, the fact they tried to setup the
IF construct makes me suspect the code isn't working as originally
intended. So Joe's simplified version may just be maintaining a previously
undetected bug.

While I would never blithely remove a complex IF like that, I was simply
trying to illustrate a common problem: fixing the technical details
without paying mind to the bigger picture, which in this case is the
fact that the code is broken. Why migrate code when it obviously
doesn't work?

If I saw something like that in code, before simplifying to Joe's method I
think it would be prudent to try to find out what the various fields and
codes mean and whether a (different and corrected) form of the IF statment
should be implemented. Using free form and parentheses around each AND set
and new lines for each OR condition can make the corrected code much easier
to follow.

In essence, identify the business requirement and write the appropriate
code. Which in this case, as Barbara hypothesized and as Cyndi
corroborated, since the code has been in place so long, is to simply
code the single line replacement.

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

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.