Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional STRTRAN
Message
 
 
À
09/02/2015 11:59:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01615018
Message ID:
01615025
Vues:
41
>>>>Yes, that would work.
>>>
>>>Thanks. Although it would be a lot better to come up with a list of LEGAL characters. The illegal one will turn out to be rather long. Thanks again.
>>
>>In this case you can do double chrtran. I used this technique a lot when I knew allowed characters.
>I'm sorry. What's a 'double chrtran'?
lcBadField = 'abc%^#$12aac'

lcGoodChars = 'abc'

*lcFixedField = CHRTRAN(CHRTRAN(lcBadField, lcGoodChars, ''), lcBadField,'')


lcBadChars = CHRTRAN(lcBadField, lcGoodChars, '')
lcFixedField = CHRTRAN(lcBadField, lcBadChars, REPLICATE('*', LEN(lcBadChars)))
=MESSAGEBOX(lcFixedField)
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform