|
I used to use the following example in my RPG IV classes back when OS/400
V3R1 was about to ship:
RPG III Style:
C STATE IFEQ 'OREGON'
C STATE OREQ 'WASHINGTON"
C STAET OREQ 'IDAHO'
C ELSE
C MOVE '0' NWSTATE
C ENDIF
In RPG IV you'd can simply code the word "NOT" in front of the conditional
expression and avoid the ELSE statement altogether.
-Bob Cozzi
www.RPGxTools.com
If everything is under control, you are going too slow.
- Mario Andretti
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Tony Carolla
Sent: Friday, March 11, 2005 4:58 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Convert QUERY record select to RPG
<snip>
> The idea is to select all of the records you don't want with the if
> statement, then immediately have an Else line. It simplifies many
filters.
>
> For instance, an if statement listing all of the States excepting Oregon
> could as easily be an if Oregon, Else.
</snip>
Why not simply use
If Not Oregon;
// Stuff;
EndIf;
???
--
"Enter any 11-digit prime number to continue..."
--
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-2025 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.