×
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.
Some of us were taught various techniques and logic to assist with the
readability and performance of the type coding that was around in RPG
II and
III.
Dennis was referring to the technique of always testing to the positive
where possible.
Thanks, Norm, that's about it. Except that when I learned this, it wasn't
about RPG II or III; wasn't even about RPG at all in fact, it was about
programming. The idea is about putting it the way the mind will be most
comfortable with it.
Please forgive the digression: Simon mentioned something about COBOL doing
one thing better than RPG (but he seemed to question his own logic ;)).
But COBOL's condition names are phenomenal answers to this type of problem.
With condition names, you can have something like:
77 weekday-number pic 9.
88 Sunday value 0.
88 weekday values 1 thru 5.
88 weekend values 0, 6.
88 odd-school-days values 1, 3, 5.
88 even-school-days values 2, 4.
With such data definitions, you can write code like
IF Sunday ...
IF odd-school-days ...
IF weekday ...
(For those who "don't get it," the above are all tests of the value of
variable "weekday-number".) Now THAT is programmer-friendly! Never a need
to code to the negative. Too bad we don't have that in RPG!
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
There will be a rain dance Friday, weather permitting
As an Amazon Associate we earn from qualifying purchases.