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



Now that you guys have this all settled....

BEWARE of the "OR"

The real problem comes in when you have an "OR" condition in the logic.
Every time you encounter an OR condition, you need to use parentheses to
logically group your statements when converting RPGII code to new-style
code...

For example if the original code looked something like...

C       N01 02
COR N01 03
COR N01 04


and you were converting this code, you need to use parentheses when
converting each group of related statements in order for it to be logically
the same as the original code.

You CANNOT express it like this:
IF  NOT *IN01 AND *IN02  OR  NOT *IN01 AND *IN03  OR  NOT *IN01 AND *IN04...

Upon conversion, this would have have to be expressed as
IF (NOT *IN01 AND *IN02) OR  (NOT *IN01 AND *IN03) OR  (NOT *IN01 AND *IN04)
....

OR to simplify (in this particular case the NOT *IN01 can be factored out by
itself and grouped with parentheses),
IF ((NOT *IN01) AND  (*IN02 OR *IN03 OR *IN04))...


As one of my geek buddies likes to say (using RPGII-style logic to construct
a sentence in English):

That's NOT like something you've NEVER seen before....OR  That's NOT UNLIKE
something you've EVER seen before...

(i.e., it IS like something you have seen before...)

Steve Landess


----- Original Message -----
From: "Scott Mildenberger" <Smildenber@Washcorp.com>
To: <rpg400-l@midrange.com>
Sent: Monday, December 02, 2002 3:58 PM
Subject: RE: notted boolean expressions (was: output specs and indicators)


> Rick,
>
> You've got it.
>
> Scott Mildenberger
>
> > -----Original Message-----
> > From: Richard B Baird [mailto:rbaird@esourceconsulting.com]
> > Sent: Monday, December 02, 2002 2:56 PM
> > To: rpg400-l@midrange.com
> > Subject: RE: notted boolean expressions (was: output specs and
> > indicators)
> >
> >
> >
> > just so I'm clear, (so far, what I originally thought was
> > right, I think
> > was right)
> >
> > not *in10 and *in11 and *in12
> >
> > is the same as
> >
> > *in11 and not *in10 and *in12
> >
> > is the same as
> >
> > *in11 and *in12 and not *in10
> >
> > right?
> >
> > so, it doesn't matter where the not is, it applys to, and only to, the
> > boolean expression directly to the right of it.
> >
> > (although, for emphasis, i'd use parens too)
> >
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> 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.