home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
vsecom3.zip
/
WINDOW2.VRX
< prev
next >
Wrap
Text File
|
1994-12-27
|
8KB
|
295 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:
LIBO = InitArgs.1
LIB = InitArgs.2
SUB = InitArgs.3
PRTO = InitArgs.4
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_10_Click
*/
PB_10_Click:
values = Window10( VRWindow(), "MEMD",LIB,LIBO,SUB)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB "," MEMNAME
msgtext = "YOU WANT TO DELETE?!:"||MEMNAME||" FROM:" LIB"."SUB
button.0 = 2
button.1 = "YES"
button.2 = "NO!"
call VRMessage VRWindow(),msgtext,"MEMBER DELETE(S)!","I","button.",1,2
if result = 2 then return
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) ACC S="||LIB||"."||SUB" ; DEL "MEMNAME
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_1_Click
*/
PB_1_Click:
values = Window10( VRWindow(), "LIB",LIB,LIBO)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB ","
RECCOM = "RECEIVE "||LIBFILE||" "||TS||" (FILE=LCMD) LD L="||LIB||" OUT=STATUS"
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_2_Click
*/
PB_2_Click:
values = Window10( VRWindow(), "SUBL",LIB,LIBO,SUB)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB ","
RECCOM = "RECEIVE "||LIBFILE||" "||TS||" (FILE=LCMD) ACC S="||LIB||"."||SUB" ; LD *.*"
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_3_Click
*/
PB_3_Click:
values = Window10( VRWindow(), "SUBC",LIB,LIBO,"NEWSUB?")
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB ","
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) DEFINE S="||LIB||"."||SUB
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_4_Click
*/
PB_4_Click:
values = Window11( VRWindow(), "RENSUB",LIB,LIBO,SUB)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB "," . "," NEWSUB ","
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) REN S="||LIB||"."||SUB" "LIB||"."NEWSUB
rc = Startvio(RECCOM)
if rc = "QUIT" then return
SUB = NEWSUB
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_5_Click
*/
PB_5_Click:
values = Window10( VRWindow(), "SUBD",LIB,LIBO,"DELETE?")
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB ","
msgtext = "YOU WANT TO DELETE?!:"||LIB||"."SUB
button.0 = 2
button.1 = "YES"
button.2 = "NO!"
call VRMessage VRWindow(),msgtext,"SUBLIBRARY DELETE!","W","button.",1,2
if result = 2 then return
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) DEL S="||LIB||"."||SUB
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE " LPT1:"
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_6_Click
*/
PB_6_Click:
MEMNAME = "List(s)?:*.*"
values = Window10( VRWindow(), "MEML",LIB,LIBO,SUB,"MEMBER?")
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB "," MEMNAME
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) ACC S="||LIB||"."||SUB" ; LD "||MEMNAME
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_7_Click
*/
PB_7_Click:
NEWMEM = "NEWNAME?"
MEMNAME = "OLDNAME?"
values = Window11( VRWindow(), "RENMEM",LIB,LIBO,SUB,"OLDNAME?","NEWNAME?")
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB "," MEMNAME "," NEWSUB "," NEWMEM ","
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) ACC S="||LIB||"."||SUB"; REN "MEMNAME" "NEWMEM
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_8_Click
*/
PB_8_Click:
values = Window11( VRWindow(), "COPY",LIB,LIBO,SUB)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB "," MEMNAME "," NEWSUB "," NEWMEM "," NEWLIB ","
RECCOM = "RECEIVE "||LIBFILE||" "TS||" (FILE=LCMD) CONN S="||LIB||"."||SUB||" "NEWLIB||"."NEWSUB||"; COPY "||MEMNAME
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
return
/*:VRX PB_9_Click
*/
PB_9_Click:
values = Window10( VRWindow(), "SEARCH",LIB,LIBO,SUB)
if values = "" then return
parse var values CHKPRT "," CHKVIEW "," LIBFILE "," LIB "," SUB "," MEMNAME ","
RECCOM = "RECEIVE "||LIBFILE||" TS (FILE=LCMD) SEARCH "||MEMNAME||" LIB="LIB
rc = Startvio(RECCOM)
if rc = "QUIT" then return
if CHKPRT = "1" then COPY LIBFILE PRTO
if CHKVIEW = "1" then E LIBFILE
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