|
Cool, now we just need to know if %trimL maps to that MI instruction, and if it does not, then we can do performance tests to see which one is faster. Bob > -----Original Message----- > From: rpg400-l-admin@midrange.com > [mailto:rpg400-l-admin@midrange.com] On Behalf Of Tom Daly > Sent: Wednesday, July 17, 2002 3:50 PM > To: rpg400-l@midrange.com > Subject: (no subject) > > > Just for kicks I did some digging. Check out the > triml mbr in qsysinc/mih. I don't have any > performance numbers but if you want to trim off a > trailing character X you could use this and then > %substr. > > Example code down & dirty... but it works. > > H DFTACTGRP(*NO) ACTGRP('QILE') > > H BNDDIR('QC2LE' : 'QUSAPIBD') > > FQPRINT O F 80 PRINTER > > F OFLIND(*IN99) > > * > > D triml PR 10i 0 ExtProc('triml') > > D * Value > options(*string) > D 1 value > char to trim > * > > D STR1 C 'A test string > w/blanks ' > D STR2 C 'String with > lots of punctuation!!!!- > D !!!!!!!' > > * > > D TrimLen S 10i 0 > > * > > C EVAL TrimLen = triml(str1 : ' > ') > C EXCEPT EX0010 > > * > > C EVAL TrimLen = triml(str2 : > '!') > C EXCEPT EX0010 > > * > > C EVAL *INLR = *ON > > * > > OQPRINT E EX0010 1 > > O TrimLen > > > > Output: > File . . . . . : QPRINT > Control . . . . . > Find . . . . . . > *...+....1....+....2....+....3.... > 0000000022 > 0000000031 > > | -----Original Message----- > | From: Bob Cozzi [mailto:cozzi@rpgiv.com] > | Subject: RE: %trim > | > | Also, when will you add the second parameter to > %TRIM/R/L > | that supports > | a character string value, so we can trim off more > than just blanks? > > > > | So does that mean %trim() should be a candidate to > be moved > | to the MI > | level (or whatever that means in today's world)? > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Autos - Get free new car price quotes > http://autos.yahoo.com > _______________________________________________ > 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 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.