Yeah, the named constants is probably a good idea. And I'll probably do
that. I also agree that the parens look cleaner. Sometimes when you are
under pressure and in a rush you go for "working" instead of sticking to
good practices.
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
"Dave" <dave@xxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
06/13/2009 10:32 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
"RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Re: Multiple Conditions on a DOW loop
Maybe it is just me, and I know it is a style choice, but I prefer parens
if
there is more than one condition being tested.
It makes it a lot clearer to read (to me), especially if the comparisons
get
a little complex with multiples ands/ors.
I would have written it like this:
dow (shopDays(DDYIndex) <> '') and (shopDays(DDYIndex) <> 'A');
For the benefit of coders coming behind me, I think I would have also used
some name constants in the comparison: cWorkDay, cHoliday, cWeekend,
cAltWorkDay....
Dave
--------------------------------------------------
From: "Bryce Martin" <BMartin@xxxxxxxxxxxx>
Sent: Saturday, June 13, 2009 7:13 AM
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>
Subject: Re: Multiple Conditions on a DOW loop
I removed the parens and it worked. I don't know. I can't figure out
why
it would not work yesterday, then today I add the parens, recompile then
it works. Then I remove the parens, recompile, and it works again. Who
knows. It now works as I expect that it should have.
As an Amazon Associate we earn from qualifying purchases.