|
Swap position of the conditions:
dow myvariable <> 'A' and myvariable <> '';
Perhaps RPG employs "short circuit" evaluation. In your condition below
myvar is <> '' is already true ('A' <> '') so does not need to compare to
'A'. This switch makes the more restrictive condition be evaluated first
(unless optimization is in effect).
Or invert the logic:
dow not (myvariable = '' or myvariable = 'A');
HTH,
Loyd
On Fri, Jun 12, 2009 at 3:13 PM, Bryce Martin <BMartin@xxxxxxxxxxxx> wrote:
Ok Group. I have run into an interesting problem...--
I have this loop structure...
dow myVariable <> '' and myVariable <> 'A';
// I do some stuff
// At some point myVariable could be set to '' or A or another value
// at which point we want to run the loop again.
enddo;
But when myVariable = 'A' the loop runs anyway.
Can we not put multiple conditions on a DOW loop? Is my brain not reading
my logic correctly today?
This is the RPG programming on the IBM i / System i (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 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.