Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert Name to Numeric equivalent characters
Message
From
25/11/1998 16:23:59
 
 
To
25/11/1998 16:09:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00161583
Message ID:
00161603
Views:
20
>I have a process that uses an IVR system to access acount information. Since consumers use their phones to access their accounts, I convert their names to a numeric character value. I use character instead of numerics because of international zip codes that use characters in their zip codes. I use a series of case statements that evaulate each letter sent, using the '$' function.
>Code sample:
>
> CASE lcthischar $ 'A,B,C,2'
> lcnewchar = '2'
>
>So if the character being evaluated is a 'B', it returns a character 2. I am attempting to optimize this conversion, but I have yet to come up with anything that works quicker.
>Any ideas?

I don't have a FPW reference handy, but in VFP, CHRTRANC() is faster and cleaner code. The following is an example:
cTransFrom='ABCDEFGHIJKLMNO'
cTransTo='222333444555666'
? CHRTRANC('BEGIN',cTransFrom,cTransTo)  && displays 23446
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform