|
What you are missing is that the computer IS doing the (X < 10) first. As soon as it gets done evaluating that part of the formula it goes back to the default left to right processing. If X = 5, the formula would become A AND B AND 'true' --- Scott > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Dan > Sent: Thursday, March 20, 2003 2:35 PM > To: RPG programming on the AS400 / iSeries > Subject: Re: Operation Precedence questions > > > --- Douglas Handy <dhandy1@xxxxxxxxxxxxx> wrote: > > Dan, > > > > >What if your example were thus: > > > A AND B AND X < 10 > > > > That becomes the equivalent of > > > > A and B and ( X < 10 ) > > > > Thus we are now reduced to only have AND clauses, which are > short-circuit > > evaluated from left to right. So unless both A and B are > true, it never has to > > evaluate ( X < 10 ). > > > > See? > > > > Doug > > Unfortunately, no, I don't. As I see it, the parentheses > surrounding X < 10 *guarantees* that it > will be evaluated before the ANDs are tested. Again, > pointing to the Precedence of Operations: > <Snip>
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.