Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TRANSFORM and stripping out characters
Message
 
 
To
27/08/2008 14:16:20
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01342279
Message ID:
01342282
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform