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



Neither changing the order nor inverting the logic will effect the
results...that's basic Boolean logic.

In addition, short circuit evaluation for AND's stops with the first
FALSE; while short circuit evaluation for OR's stops with the first
TRUE.

HTH,
Charles

On Fri, Jun 12, 2009 at 4:32 PM, Loyd Goodbar<loyd@xxxxxxxxxxxxxx> wrote:
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 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.