home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / pocketbk / developmen / oplexamp / DTMF.OPL < prev    next >
Text File  |  1992-08-26  |  896b  |  38 lines

  1. REM A Series 3 proc to dial DTMF tones from OPL
  2. REM Written by DWW Psion Plc January 1992
  3. proc main:
  4.   local d$(24)
  5.   d$="1234567890*#"
  6.   DO
  7.     dINIT
  8.     dEDIT d$,"Dial"
  9.     IF DIALOG=0
  10.       STOP
  11.     ENDIF
  12.     dtmf:(d$)
  13.   UNTIL 0
  14. endp
  15.  
  16. proc dtmf:(dial$)
  17.   local    h%        REM Handle of SND:
  18.   local z%        REM Points to start of zts
  19.   local r%        REM Result of ioopen
  20.   local zts$(25)    REM zts version of dial$
  21.   local edial%(2)    REM First word is sum of two bytes 
  22.             REM first byte is tone length
  23.             REM second byte is delay length
  24.             REM second *word* is pause length
  25.             REM - all in secs/32
  26.   zts$=dial$+chr$(0)    
  27.   z%=addr(zts$)+1    REM Skip length byte
  28.   edial%(1)=8+(256*8)    REM Standard defaults
  29.   edial%(2)=48
  30.   r%=ioopen(h%,"SND:",0)
  31.   IF r%=0
  32.     iow(h%,10,#z%,edial%())
  33.     ioclose(h%)
  34.   else
  35.     gIPRINT "Error opening SND: "+err$(r%)
  36.   endif
  37. endp
  38.