On Dec 4, 2007 8:05 AM, Deepak Gupta <[EMAIL PROTECTED]> wrote:
> Can anyone tell me or point me to a Macro or coldfusion code to convert
> letters to numbers on phone keypad. For example
>
> ABDG will be 2234
>
> And this way I have a lot of Names in database and I have to pick first 4
> letters from the name and convert them into 4 digit codes from phone keypad.
Create a struct with 26 keys (the letters of the alphabet) and values
for the digits on the phone. Then you just use lookup[letter] and get
back the value.
In CF8 this would be:
lookup = { a=2, b=2, c=2, d=3, e=3, f=3, g=4, h=4, i=4, j=5, k=5, l=5,
m=6, n=6, o=6, p=7, q=7, r=7, s=7, t=8, u=8, v=8, w=9, x=9, y=9, z= 9
};
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294197
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4