home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
515.lha
/
BackTalk_v1.40
/
rexx_examples
/
dialer.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1991-06-08
|
1KB
|
63 lines
/* Infinite dialing loop example */
/*
A simple dialer example. Will redial indefinitely
until a CONNECT is made.
*/
options results
if ~show('l', "rexxsupport.library") then
addlib('rexxsupport.library',0,-30,0)
address command "run work:telecom/backtalk"
waitforport BT_REXX
address BT_REXX
openport("BT_msg")
ONSTRING "CONNECT"
OFFSTRING "BUSY"
call delay 150
number = "ATDT 555-1234"
SEND number /* dial the number */
keepgoing = TRUE
do while keepgoing = TRUE
packet = getpkt("BT_msg")
do while packet = '00000000'x
call waitpkt("BT_msg")
packet = getpkt("BT_msg")
end
arg0 = getarg(packet)
call reply(packet,0)
select
when arg0 = "OFF" then call doBusy
when arg0 = "MATCH" then call doConnect
otherwise nop
end
end
/* after you do connect the above loop will fall out */
/* so put the rest of your script here */
RESET
exit
doBusy:
ONSTRING "CONNECT"
OFFSTRING "BUSY"
HANGUP
call delay 150 /* give time for HANGUP to take effect */
SEND number
return
doConnect:
OFFSTRING
keepgoing = FALSE
return