|
Dan, I think you've missed the implicit aspects of all this. A AND B AND C is logically (A AND B) AND C which is also ((A AND B) AND C) Additionally, an indicator field is actually an expression of whether the indicator is on. IF *IN90 is actually IF (*IN90 = '1') Therefore, your expression A AND B AND X < 10 is actually (((A = '1') AND (B = '1')) AND (X < 10)) the program evaluates if the inner left expression (A = '1') is true, if so, then evaluates if the inner right expression (B = '1') is true, if so, then if the middle left expression (A = '1' AND B = '1') is true. if so, then if the middle right expression (X < 10) is true, if so, finally if the expression as whole is true. Once you supply the "missing" implicit aspects, you'll see that the rules DO apply. Jim Dan <dbcerpg@xxxxxxxxx> To: RPG programming on the AS400 / iSeries Sent by: <rpg400-l@xxxxxxxxxxxx> rpg400-l-bounces@xx cc: drange.com Subject: Re: Operation Precedence questions 03/20/2003 02:18 PM Please respond to RPG programming on the AS400 / iSeries Hi Barbara, Now I *know* I'm going to be set straight on this! However, never content to let the highest authority on a given subject leave a question unanswered <g>... Your example does not include the use of the =, <>, >, >=, <, <= operators. What if your example were thus: A AND B AND X < 10 According to the rules of Operation Precedence, the X < 10 should be evaluated before A AND B. Where am I going wrong on this? - Dan --- Barbara Morris <bmorris@xxxxxxxxxx> wrote: <snip> > Dan, in the expression A AND B AND C, there are actually two AND > expressions: > A AND B > "value of A AND B" AND C > For the first one, if A is false, B isn't evaluated. For the second > one, if "value of A AND B" is false, C isn't evaluated. __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com _______________________________________________ This is the RPG programming on the AS400 / iSeries (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.