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



That wouldn't work because it would keep on looping as long as the second when passed, totally ignoring the first part of the AND condition.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx

-----rpg400-l-bounces@xxxxxxxxxxxx wrote: -----
To: "'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
From: "Dennis Lovelady"
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
Date: 11/10/2010 04:21PM
Subject: RE: How to read and or statement

I wouldn't let the difference between IF and WHEN stand in the way of the
approach Scott uses (which happens to match what I tend to do).

I would simply put in another WHEN with like actions.  If the actions are
more than a few statements, then I'd proceduralize or at least make SUBR of
them.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--

"He is so unlucky that he runs into accidents which started out to happen to
somebody else."
        -- Don Marquis


I would probably do it that way as well, but it is not exactly the
same, since the first statement contained a WHEN.

If *INKF were off or both condition1 and condition2 were on, the next
WHEN statement would be executed.

Albert

On Wed, Nov 10, 2010 at 12:14 PM, Scott Klement
<rpg400-l@xxxxxxxxxxxxxxxx> wrote:
Shrug... I wrote complex logical expressions in RPG III..  I just
didn't
intermix AND/OR the way David demonstrated.

I'd do something more like this:

C     *INKF         IFEQ      *ON
C     CONDITION1    IFEQ      FALSE
C     CONDITION2    OREQ      FALSE
...
C                   ENDIF
C                   ENDIF

That way, I didn't get confused by which one took precedence...
starting a new IFxx statemnet controlled my precidence.

But I much prefer having parenthesis, and I can't see why someone
would
use the godawful IFxx/ORxx/ANDxx stuff today.




On 11/10/2010 9:25 AM, Jon Paris wrote:
It is exactly these kinds of problems that convinced me many years
ago
that nobdoy ever wrote even mildly complex logical expressions in
RPG
III.

But many millions were debugged!


Jon Paris

www.Partner400.com
www.SystemiDeveloper.com



On Nov 10, 2010, at 9:43 AM, rpg400-l-request@xxxxxxxxxxxx wrote:

heh heh...  You answered your own question, and you made the case
for
giving up the old style.

Why not try the code, just as you want it (except change the if to
a
when), and see if it works?


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


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

Follow-Ups:
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.