home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
vsecom3.zip
/
WINDOW4.VRX
< prev
next >
Wrap
Text File
|
1994-12-15
|
5KB
|
226 lines
/*:VRX Main
*/
/* Main
*/
Main:
/* Process the arguments.
Get the parent window.
*/
parse source . calledAs .
parent = ""
argCount = arg()
argOff = 0
if( calledAs \= "COMMAND" )then do
if argCount >= 1 then do
parent = arg(1)
argCount = argCount - 1
argOff = 1
end
end
InitArgs.0 = argCount
if( argCount > 0 )then do i = 1 to argCount
InitArgs.i = arg( i + argOff )
end
drop calledAs argCount argOff
/* Load the windows
*/
call VRInit
parse source . . spec
_VREPrimaryWindowPath = ,
VRParseFileName( spec, "dpn" ) || ".VRW"
_VREPrimaryWindow = ,
VRLoad( parent, _VREPrimaryWindowPath )
drop parent spec
if( _VREPrimaryWindow == "" )then do
call VRMessage "", "Cannot load window:" VRError(), ,
"Error!"
_VREReturnValue = 32000
signal _VRELeaveMain
end
/* Process events
*/
call Init
signal on halt
do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
_VREEvent = VREvent()
interpret _VREEvent
end
_VREHalt:
_VREReturnValue = Fini()
call VRDestroy _VREPrimaryWindow
_VRELeaveMain:
call VRFini
exit _VREReturnValue
VRLoadSecondary: procedure
name = arg( 1 )
window = VRLoad( VRWindow(), VRWindowPath(), name )
call VRMethod window, "CenterWindow"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
return window
/*:VRX Fini
*/
Fini:
window = VRWindow()
call VRSet window, "Visible", 0
drop window
return 0
/*:VRX Halt
*/
Halt:
signal _VREHalt
return
/*:VRX Init
*/
Init:
call RxFuncAdd 'SysSleep' , 'RexxUtil', 'SysSleep'
TS = "A:"
window = VRWindow()
call VRMethod window, "CenterWindow","DESKTOP"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
drop window
return
/*:VRX PB_12_Click
*/
PB_12_Click:
MEMNAME = "Lock Member?"
values = Window2( VRWindow(), "LOCK",LIB,SUB,MEMNAME)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB "," MEMNAME
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) ACC S="||LIB||"."||SUB" ; LOCK "||MEMNAME||" LOCKID="LUSER
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE " LPT1:"
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_13_Click
*/
PB_13_Click:
MEMNAME = "UNlock Member?"
values = Window2( VRWindow(), "UNLOCK",LIBNAME,SUBNAME,MEMNAME)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIBNAME "," SUBNAME "," MEMNAME
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) ACC S="||LIBNAME||"."||SUBNAME" ; UNLOCK "||MEMNAME||" LOCKID="LUSER
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE " LPT1:"
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_14_Click
*/
PB_14_Click:
values = Window13( VRWindow())
if values = "" then return
trtype = values
if trtype = "OTH" then do
SRcom = " "
button.0 = 2
button.1 = "OK"
button.2 = "CANCEL"
call VRPrompt VRWindow(),"ENTER A SEND/RECEIVE COMMAND:", "SRcom", "EXECUTE AN EXPLICIT SEND/RECEIVE COM STRING", "button.",1,2
if result = 2 then return
rc = Startvio(SRcom)
return
end
trtype = "SEND"
values = Window14( VRWindow(),trtype)
if values = "" then return
parse var values part1 "," part2 "," part3
RECCOM = "SEND "||part1||" "TS||" "||part2||" "||part3
say reccom
rc = Startvio(RECCOM)
if rc = "QUIT" then return
return
/*:VRX PB_15_Click
*/
PB_15_Click:
values = Window13( VRWindow())
if values = "" then return
trtype = values
if trtype = "OTH" then do
SRcom = " "
button.0 = 2
button.1 = "OK"
button.2 = "CANCEL"
call VRPrompt VRWindow(),"ENTER A SEND/RECEIVE COMMAND:", "SRcom", "EXECUTE AN EXPLICIT SEND/RECEIVE COM STRING", "button.",1,2
if result = 2 then return
rc = Startvio(SRcom)
return
end
trtype = "REC"
values = Window14( VRWindow(),trtype)
if values = "" then return
parse var values part1 "," part2 "," part3
RECCOM = "RECEIVE "||part1||" "TS||" "||part2||" "||part3
say reccom
rc = Startvio(RECCOM)
if rc = "QUIT" then return
return
/*:VRX Quit
*/
Quit:
window = VRWindow()
call VRSet window, "Shutdown", 1
drop window
return
/*:VRX Startvio
*/
Startvio:procedure
parse arg command
erase "c:\vsecom\vsestat.fil"
"start /win/c c:\vsecom\runvse.cmd" command "<con >con"
/*"start /win/c c:\vsecom\runvse.cmd" command*/
SPINNUM = 0
RC = ""
DO FOREVER
call SysSleep 2
exists = VRFileExists("C:\vsecom\vsestat.fil")
if exists = 1 then do
LEAVE
end
else do
SPINNUM = SPINNUM + 1
end
if SPINNUM = 5 then do
SPINNUM = 0
rc = Window7(VRWindow())
end
if rc = "QUIT" then do
LEAVE
end
end
return rc
/*:VRX Window1_Close
*/
Window1_Close:
call Quit
return