FireGeek21
Technical User
HI!
I need to remove all special characters from a field except spaces. I found the following code here on Tek-Tips however it is also removing spaces too. Now my an address such as 1234 O'Mally Street appears 1234OMallyStreet and I need 1234 OMally Street. I know the ascii character for space is 32 but it isn't in the code. Help! THANKS!
FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
I need to remove all special characters from a field except spaces. I found the following code here on Tek-Tips however it is also removing spaces too. Now my an address such as 1234 O'Mally Street appears 1234OMallyStreet and I need 1234 OMally Street. I know the ascii character for space is 32 but it isn't in the code. Help! THANKS!
Code:
whileprintingrecords;
Stringvar MyOutput:="";
Stringvar MyInput:= {EMPLOYEE.ADDR1};
numbervar Counter;
For Counter := 1 to len(trim(MyInput)) do(
if asc(mid(MyInput,Counter,1)) in [65 to 90]
or
asc(mid(MyInput,Counter,1)) in [48 to 57]
or
asc(mid(MyInput,Counter,1)) in [97 to 122]
then
MyOutput:=MyOutput+mid(MyInput,Counter,1)
);
MyOutput
FireGeek
(currently using Crystal Reports XI with Lawson 9.01)