Eric, nice, avoids the array, challenges my brain...
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DeLong, Eric
Sent: Friday, March 01, 2013 10:36 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: Its Friday
I have sometimes used %scan() to provide some similar functionality. There are some risks associated with this, so take care to not hurt yourself...
myCustomerExemptTypes = '("NONEXEMPT", "RETAILEXEMPT", "FULLYEXEMPT")'; chain myCust Customer; if %scan( '"'+%trim(CustExTyp)+'"' : myCustomerExemptTypes ) > 0;
// non-zero means FOUND (is Valid)
Endif;
It's important to use delimiters to define values, and to enclose the scan string in like fashion. Parentheses for the list string are not necessary, but I like to use them (or [], {}) to so some sort of "dataset" relationship.
Hth,
-Eric DeLong
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Friday, March 01, 2013 10:44 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Its Friday
Ever wonder why there is no If IN (not to be confused with *IN) ?
If MyCharVar In ('A','B','C');
MyFace = ': )';
Else;
MyFace = ':(';
Endif;
--
This is the RPG programming on the IBM i (AS/400 and 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.
--
This is the RPG programming on the IBM i (AS/400 and 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.