|
Hans, Here's what I've got now... works great! for i = 1 to %Len(szInValue) eval ch = %subst(szInValue:I:1) if memchr(%addr(SaveMe)+2:CharInt:%len(SaveMe))<>*NULL eval CleanVal = CleanVal + %subst(szInValue:I:1) endif endfor // Return the clean number to the caller, as text. return CleanVal -Bob -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Hans Boldt Sent: Tuesday, June 01, 2004 10:39 AM To: rpg400-l@xxxxxxxxxxxx Subject: Re: trimming non-numerics joe wrote: > Hans, > > I notice in your FOR loop you are evaluating the length, %len(source), each > time through the loop. > is it necassary to call the bif each time? ... I notice Cozzi is doing the > same thing. > > joe > Joe: If you're concerned about performance, then do some performance testing on the alternatives. But in this case, storing the length in some integer variable wouldn't buy much since %LEN(SOURCE) is not a performance hog. It simply does a load of the first two bytes of the character varying variable. Cheers! Hans -- 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-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.