home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / dial.zip / DIAL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-01-08  |  1KB  |  64 lines

  1. /* Telephone program
  2.    Written by Helge Hafting
  3.    email:
  4.    hafting@pvv.unit.no
  5.    snail mail:
  6.    poverudvn. 22
  7.    N-3440 R¢yken
  8.    NORWAY
  9. */
  10.  
  11. arg tlf
  12.  
  13. if (tlf='' | tlf='?') then signal hjelp
  14.  
  15. call rxfuncadd "mciRxInit", "MCIAPI", "mciRxInit"
  16. call mciRxInit
  17.  
  18. rc = mciRxSendString('open waveaudio alias lyd wait', 'RetStr', '0', '0')
  19. if rc <> 0 then signal feil
  20.  
  21. forrige = '_'
  22. do while tlf <> '' 
  23.  siffer = left(tlf,1)
  24.  tlf = substr(tlf,2)
  25.  type = pos(siffer,'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789*0#')
  26.  if type > 0 then do
  27.   if siffer = '*' then siffer='stjerne'
  28.   else if type < 27 then siffer = trunc((type + 2) / 3)
  29.   filnavn = siffer'.wav'
  30.   if siffer = forrige then rc = mciRxSendString('seek lyd to start wait', 'RetStr', '0', '0')
  31.   else rc = mciRxSendString('load lyd' filnavn 'wait', 'RetStr', '0', '0')
  32.   if rc <> 0 then signal feil
  33.   rc = mciRxSendString('play lyd wait', 'RetStr', '0', '0')
  34.   if rc <> 0 then signal feil
  35.  end
  36. end
  37.  
  38.  
  39. rc = mciRxSendString('close lyd wait', 'RetStr', '0', '0')
  40. if rc <> 0 then signal feil
  41.  
  42. call mciRxExit
  43.  
  44. exit(0)
  45.  
  46. feil:
  47. MacRC = mciRxGetErrorString(rc, 'ErrStVar')
  48. say 'error' rc',' ErrStVar
  49. rc = mciRxSendString('close lyd wait', 'RetStr', '0', '0')
  50. call mciRxExit
  51. exit(rc)
  52.  
  53. hjelp:
  54. say
  55. say 'Usage: dial <phone number>'
  56. say 'Examples:'
  57. say
  58. say 'dial 1234567'
  59. say 'dial (865) 9-ABC-567'
  60. say 'dial 12-345-76 *5 *2 ##4'
  61. exit(0)
  62.  
  63.  
  64.