Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Phone number
Message
 
To
12/05/2005 19:18:15
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01013608
Message ID:
01013664
Views:
14
>Borislav,
>
>Or, the strfilter() function hidden in FoxTools.fll
>
>set library to foxtools.fll additive
>lcPhone = strfilter( lcPhone, "0123456789" )
>
>The strfilter() function filters out all chars except those listed in the 2nd parm.
>
>What I like about this function is that its easy to understand what its doing when I see it my source code.
>
>Malcolm


Hi Malcolm...

It's obviously not as readable as the strfilter() function, but the following does the same thing:
chrtran(lcPhone,chrtran(lcPhone,"0123456789",""),"")
The inner chrtran() gets rid of all the numeric characters, leaving everything else. Then that result is used to get rid of all of THOSE characters in the outer chrtran().

Obviously not very readable or intuitive at all, but it eliminates the need for FoxTools. You could just put that in a procedure library:
function mystrfilter
lparameters tcString,tcCharsToFilter
return chrtran(tcString,chrtran(tcString,tcCharsToFilter,""),"")
--Brad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform