|
Hi, David:
You can always use extra parentheses, even if they are "redundant" --
to ensure the compiler knows exactly what you want.
So, for example, you could code something like this:
WHEN (*INKF *AND ((COND1 = FALSE) *OR (COND2 = FALSE)))
and that way, there should be no doubt (by the compiler or any
subsequent human readers) of what is intended.
When in doubt, parenthesize.
Hope that helps,
Mark S. Waterbury
> On 11/10/2010 12:24 PM, David FOXWELL wrote:
note to self : AND has higher precedence...AND has higherprecedence...AND has higher precedence...AND has higher
precedence...AND has higher precedence...AND has higher
precedence...AND has higher precedence...AND has higher precedence...AND has higher precedence...
--
-----Message d'origine-----
De :rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Elbert Cook
Envoyé : mercredi 10 novembre 2010 14:35 À : 'RPG programming on
the IBM i / System i'
Objet : RE: How to read and or statement
Here is a clip from the V5R4 RPG Reference
Condition for the DOUxx, DOWxx, IFxx, and WHENxx operations.
The ANDxx operation has higher precedence than the ORxx operation.
-----Original Message-----
From: David FOXWELL [mailto:David.FOXWELL@xxxxxxxxx]
Sent: Wednesday, November 10, 2010 4:09 AM
To: RPG programming on the IBM i / System i
Subject: How to read and or statement
Consider this code :
C *INKF WHENEQ *ON
C CONDITION1 ANDEQ FALSE
*If I add :
C CONDITION2 OREQ FALSE
I think this now means :
IF (*INKF AND CONDITION1=FALSE) OR (CONDITION2=FALSE)
But I want :
IF *INKF AND (CONDITION1=FALSE OR CONDITION2=FALSE)
Which is right?
Thanks
--
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<email%3ARPG400-L-request@midran
ge.com> Before posting, please take a moment to review the archives
athttp://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i / System i
(RPG400-L) mailing list
To post a message
email:RPG400-L@xxxxxxxxxxxx<email%3ARPG400-L@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit:http://lists.midrange.com/mailman/listinfo/rpg400-l
or
email:RPG400-L-request@xxxxxxxxxxxx<email%3ARPG400-L-request@midran
ge.com> Before posting, please take a moment to review the archives
athttp://archive.midrange.com/rpg400-l.
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.