home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: OtherApp
/
OtherApp.zip
/
rhinodem.zip
/
rcdemo.dat
/
os2share.rrx
< prev
next >
Wrap
Text File
|
1995-09-19
|
2KB
|
112 lines
/* sample RhinoCom script that connects to the OS/2 Shareware BBS */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
CR = '0d'x
NL = '0a'x
ESC = '1b'x
/*
* Check the phone number field of the RhinoCom Notebook.
* If the number has not been filled in, ask the user for one,
* and place it in the field.
*/
RQUERY 'phone-number'
phone = rc
if phone = '' then do
ENTRYFIELD '"Enter Phone Number" "OS/2 Shareware BBS"'
phone = rc
if phone = '' then signal error1
rset 'phone-number' phone
end
/*
* Do the same thing for the Username field. This is a
* little different because Username is a named macro.
* Notice that we add a CR to the users response.
*/
RQUERY '@username'
username = rc
if username = '' then do
ENTRYFIELD '"Enter Username" "OS/2 Shareware BBS"'
username = rc
if username = '' then signal error1
NMDefine "named M'username'"username
end
/*
* And again for the password. Notice that the entryfield for
* this one echoes *'s instead of the characters typed.
*/
RQUERY 'password'
password = rc
if password = '' then do
ENTRYFIELD 'UNREADABLE "Enter Password" "OS/2 Shareware BBS"'
password = rc
if password = '' then signal error1
rset 'password' password
end
/*
* set up response strings
*/
'RESPONSE 1 MATCH /What is your name:/ /EXEC username/'
'RESPONSE 2 MATCH /[Y,n]?/ /WRITE '||CR||'/'
'RESPONSE 3 MATCH /Password:/ /EXEC password/'
'RESPONSE 4 MATCH /Press ENTER to continue/ /WRITE '||CR||'/'
'RESPONSE 5 MATCH /More [Y,n,=]?/ /WRITE '||CR||'/'
'RESPONSE 6 MATCH /Do you wish to check for mail? [Y,n]/ /WRITE n/'
'RESPONSE 7 MATCH /Do you wish to check for new files? [Y,n]/ /WRITE n/'
'RESPONSE 8 MATCH /MAIN:/ //'
DIAL
call SysSleep 1
rsay CR||NL||'Dialing . . .'||CR||NL||CR||NL
/*
* as the response strings are activated, cancel them
* check for #8, which indicates we are done
*/
TIMEOUT 1
n = 0
resp_num = 0
do while n <= 60
n = n + 1
WAITANY 1 2 3 4 5 6 7 8
resp_num = rc
if ( resp_num > 0 ) & ( resp_num < 9 ) then do
RESPONSE resp_num CANCEL
n = n - 2
end
if resp_num = 8 then leave
end
/*
* make sure all the response strings get canceled
*/
RESPONSE 1 CANCEL
RESPONSE 2 CANCEL
RESPONSE 3 CANCEL
RESPONSE 4 CANCEL
RESPONSE 5 CANCEL
RESPONSE 6 CANCEL
RESPONSE 7 CANCEL
RESPONSE 8 CANCEL
exit
/*
* signal error
*/
error1:
exit