|
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.
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.