|
Carsten: Thanks, but I forgot to mention that this is V4R5. I don't see %Check there. _________________ Art Tostaine, Jr. CCA, Inc. Jackson, NJ 08527 > -----Original Message----- > From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On > Behalf Of Carsten Flensburg > Sent: Tuesday, February 05, 2002 9:38 AM > To: rpg400-l@midrange.com > Subject: Re: Find all occurences of alpha characters in a string > > > Hello Art, > > Here's one way to do it: > > D Pos s 5u 0 > D ChkAlf s 1a > D ItmNbr s 30a Inz( 'C 123 456 78F' ) > D FldAlf s 30a Varying > D FldNum s 30a Varying > ** > D Num c '0123456789' > ** > C For Pos = 1 to %Len( %TrimR( ItmNbr )) > ** > C Eval ChkAlf = %SubSt( ItmNbr: Pos: 1 ) > C If ChkAlf > *Blank > ** > C If %Check( Num: ChkAlf ) > *Zero > C Eval FldAlf = FldAlf + ChkAlf > ** > C Else > C Eval FldNum = FldNum + ChkAlf > C EndIf > C EndIf > ** > C EndFor > ** > C Return > ** > > > ----- Original Message ----- > From: "Art Tostaine, Jr." <artjr@link400.com> > To: <rpg400-l@midrange.com> > Sent: Tuesday, February 05, 2002 3:09 PM > Subject: Find all occurences of alpha characters in a string > > > > I have a field that I am trying to seperate into alpha and numeric. > > > > Examples would be: > > > > "C 123456" > > "1234567C' > > "C1 12345678" > > "C123456" > > > > I want any alpha's in one field and any numerics in another alpha field. I >will use Barbara's GETNUM to convert the > numeric portion > > to a real number later. > > > _______________________________________________ > 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.