Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting rid of non-printable junk
Message
De
15/07/1999 10:22:45
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00241748
Message ID:
00241749
Vues:
19
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform