Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TRANSFORM and stripping out characters
Message
 
 
À
27/08/2008 14:16:20
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01342279
Message ID:
01342282
Vues:
15
>The resulting value of NewFieldValue is "999-99-99" which sort of makes sense in that it is nine characters, but why did it not strip out the "-" in the original value? This works if I just substitute "-" for the AlphaToStrip in the TRANSFORM.
>
>FieldValue = "999-99-9999"
>AlphaToStrip = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ`!@#$%*()-_=+[{]}\;:,<.>/?"'
>NewFieldValue = EVALUATE("ALLTRIM(TRANSFORM(STRTRAN(FieldValue,AlphaToStrip,''), '@R " + REPLICATE('9',FieldLength) + "'))")
>
In your case you need to use CHRTRAN() function to strip unwanted chars.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform