Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting rid of non-printable junk
Message
From
15/07/1999 10:22:45
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, United Kingdom
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00241748
Message ID:
00241749
Views:
13
>Does anyone know a simple command to get rid of all non-printable characters from a field. I have a nomenclature field and the user has been entering some carriage returns, tabs, and control characters (inadvertantly) Is there a way that I can get rid of those characters and leave the alpha numeric printable stuff. I know I can do a loop reading every character and checking for its ascii value, but what I was looking for was a function that can be used in a replace statement. TIA

I use CHRTRAN in this situation

e.g.

*-- First decide what you want to get rid of
lcBadChars = CHR(13) + CHR(10) + CHR(9) + "'-&*%$£"
*-- Then dump them
REPLACE fieldname WITH CHRTRAN( fieldname, lcBadChars, "")
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform