home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
vsecom3.zip
/
WINDOW5.VRX
< prev
next >
Wrap
Text File
|
1995-09-18
|
4KB
|
175 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:
FileO = InitArgs.1
PrintO = InitArgs.2
call RxFuncAdd 'SysSleep' , 'RexxUtil', 'SysSleep'
window = VRWindow()
call VRMethod window, "CenterWindow","DESKTOP"
call VRSet window, "Visible", 1
call VRMethod window, "Activate"
drop window
return
/*:VRX PB_19_Click
*/
PB_19_Click:
FileO = FileO||"\PWROUT"
Okay = VRFileExists(FileO)
If Okay = 1 then do
Okay = VRDeleteFile(FileO)
end
usercom = " "
button.0 = 2
button.1 = "OK"
button.2 = "CANCEL"
call VRPrompt VRWindow(),"Enter A VSE POWER command:", "usercom", "EXECUTE PWR", "button.",1,2
if result = 2 then return
RECCOM = "RECEIVE "||FileO||" TS (FILE=PCMD) "||usercom
rc = Startvio(RECCOM)
if rc = "QUIT" then return
E FileO
return
/*:VRX PB_21_Click
*/
PB_21_Click:
SRcom = " "
button.0 = 2
button.1 = "OK"
button.2 = "CANCEL"
call VRPrompt VRWindow(),"ENTER A SEND/RECEIVE COMMAND:", "SRcom", "EXECUTE AN EXPLICIT SEND/RECEIVE COMMAND STRING", "button.",1,2
if result = 2 then return
rc = Startvio(SRcom)
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 = Window8(VRWindow())
end
if rc = "QUIT" then do
LEAVE
end
end
return rc
/*:VRX Window1_Close
*/
Window1_Close:
call Quit
return