home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega Top 1
/
os2_top1.zip
/
os2_top1
/
APPS
/
DATACOM
/
DIVERSEN
/
DIAL_OS2
/
RING.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-01-08
|
1KB
|
65 lines
/* Telefonprogram
Skrevet av Helge Hafting
email:
hafting@pvv.unit.no
Adresse:
poverudvn. 22
3440 R¢yken
*/
arg tlf
if (tlf='' | tlf='?') then signal hjelp
call rxfuncadd "mciRxInit", "MCIAPI", "mciRxInit"
call mciRxInit
rc = mciRxSendString('open waveaudio alias lyd wait', 'RetStr', '0', '0')
if rc <> 0 then signal feil
forrige = '_'
do while tlf <> ''
siffer = left(tlf,1)
tlf = substr(tlf,2)
type = pos(siffer,'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789*0#')
if type > 0 then do
if siffer = '*' then siffer='stjerne'
else if type < 27 then siffer = trunc((type + 2) / 3)
filnavn = siffer'.wav'
if siffer = forrige then rc = mciRxSendString('seek lyd to start wait', 'RetStr', '0', '0')
else rc = mciRxSendString('load lyd' filnavn 'wait', 'RetStr', '0', '0')
if rc <> 0 then signal feil
rc = mciRxSendString('play lyd wait', 'RetStr', '0', '0')
if rc <> 0 then signal feil
end
end
rc = mciRxSendString('close lyd wait', 'RetStr', '0', '0')
if rc <> 0 then signal feil
call mciRxExit
exit(0)
feil:
MacRC = mciRxGetErrorString(rc, 'ErrStVar')
say 'error' rc',' ErrStVar
rc = mciRxSendString('close lyd wait', 'RetStr', '0', '0')
call mciRxExit
exit(rc)
hjelp:
say
say 'Bruk: ring <telefonnr>'
say 'Eksempler:'
say
say 'ring 12345678'
say 'ring (123) 45-45-45'
say 'ring 12345678 *5 *7 ##4'
exit(0)