TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: ARNIE SOSSNER
date: 1996-01-26 03:45:00
subject: Key Pad Simulator

I am writing a program to interface with a voice answer back computer
over the telephone line.  The following is a FUNCTON to translate the
alphabet into the number characters recognized by the voice answer back
computer.  Your translation requirements might vary.
'This function translates the letters A to Z to their representation
'on the telephone dial.  For example, A is on the 2 key and is the first
'letter shown.  Q and Z are not on the dial and are represented by
'01 and 03 respectively.
'Example Use:
'PRINT  SymbolNum$("IBM")
'Expected Output: 432261
FUNCTION SymbolNum$(SymbolLet$)
   FOR Position% = 1 TO LEN(SymbolLet$)    'pick each character in turn
      ch$ = UCASE$(MID$(SymbolLet$, Position%, 1))
      SELECT CASE ch$
         CASE "Q"               'special case; not on dial
            Accumulate$ = "01"
         CASE "Z"               'special case; not on dial
            Accumulate$ = "02"
         CASE "A" TO "Y"        '"Q" "Z" CASES already handled above
               Indexer% = INSTR("ABCDEFGHIJKLMNOPRSTUVWXY", ch$)
              FirstNum$ =  MID$("222333444555666777888999", Indexer%, 1)
             SecondNum$ =  MID$("123123123123123123123123", Indexer%, 1)
            Accumulate$ = Accumulate$ + FirstNum$ + SecondNum$
        END SELECT
   NEXT
   SymbolNum$ = Accumulate$
END FUNCTION
 * OLX 2.2 * As Confucius said, "I didn't say that!"
--- WILDMAIL!/WC v4.12 
---------------
* Origin: Acorn I BBS * 1:2624/503 * Marlboro, NY * USR 28.8 (1:2624/503.0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.