Kurt, nice because the code is more contained, but,
to your point, it's like carving soap with a razor
and arrays are safer.
And, thanks to Paul Tuohy and his
"Those Weird and Wonderful Arrays" article, I use
them to provide flexible sorting for our warehouse
pallet staging function, and use a basing pointer
to switch between door arrays by delivery truck type
for door assignment.
Thank you Paul, thank you IBM RPGLE team!
But, I want my IN operator.
Monday would be nice. (please?)
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Anderson, Kurt
Sent: Friday, March 01, 2013 10:47 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: Its Friday
Wait, how is that nice?
Why would you use that method over using an array? As Eric even said, there are inherent risks to searching a string for values. I don't see the benefit.
I know it's Friday, but it's Friday 2013. (Not that arrays are a new concept.)
-Kurt
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Gary Thompson
Sent: Friday, March 01, 2013 11:43 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: Its Friday
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.
--
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.