Return to the RPG Tips
Convert uppercase to mixed case
The following code will convert Name to Upper case: C 1 Do 30 i C 1 SubSt Name:i Char 1 C BitOn '1' Char C Eval %Subst(Name:i:1) = Char C EndDo Alex Roytman Here's another way to do it: D InpFld s 256a Inz( 'MR. SANTA CLAUS' ) D ChrStr s 257a Varying D ChrAry s Like( InpFld ) Dim( 64 ) D ChrFld s Like( InpFld ) D Blank s 1a D Ix s 5u 0 D Ic s 5u 0 D Pb s 5u 0 D Pe s 5u 0 ** D Hi c 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' D Lo c 'abcdefghijklmnopqrstuvwxyz' ** C If InpFld <> *Blanks C Eval ChrStr %TrimR( InpFld ) + Blank C Eval Ix 0 ** C Blank Check ChrStr Pb C DoW %Found ** C Blank Scan ChrStr: Pb Pe C Eval Ix Ix + 1 C Eval ChrAry(Ix) %SubSt( ChrStr: Pb: Pe-Pb ) ** C Blank Check ChrStr: Pe Pb C EndDo ** C Clear ChrStr ** C Do Ix Ic C Hi:Lo Xlate ChrAry(Ic):2 ChrFld C Eval ChrStr ChrStr + ' ' + %TrimR(ChrFld) C EndDo ** C Eval InpFld %SubSt( ChrStr: 2 ) C EndIf ** C Return
[report a broken link by clicking here]