|
People have heard me rant on why I stop using CLP. Every time I go to use it (and we're on V5R3 in which CL got vastly improved), I run into a limitation that makes me hit a wall. I find myself thinking the same way about if's versus select. Every time I think I have a single case if I come up with 'the third option'. I've pretty much made it another mantra to always use select instead of if. 1 - Nested if's are bug ugly. 2 - Using select makes you think about 'the third option'. If %eof(myfile); Leave; Endif; If Itactv = 'N'; Iter; Endif; becomes Select; When %eof(myfile); Leave; When %status(myfile)<>0; // some catastrophic file error occurred and needs to be handled. When Itactv='N'; Iter; Other; // main body ... EndSl; Granted, on a 'simple' if you'd only have if x>y; // do this EndIf; Versus Select; When x>y; // Do this Endsl; That's one extra line, but a lot of easier to read code, and less code, if more comparisons start to be made regarding x and y. Rob Berendt
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.