home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vsecom3.zip / WINDOW10.VRX < prev    next >
Text File  |  1994-12-21  |  7KB  |  242 lines

  1. /*:VRX         Main
  2. */
  3. /*  Main
  4. */
  5. Main:
  6. /*  Process the arguments.
  7.     Get the parent window.
  8. */
  9.     parse source . calledAs .
  10.     parent = ""
  11.     argCount = arg()
  12.     argOff = 0
  13.     if( calledAs \= "COMMAND" )then do
  14.         if argCount >= 1 then do
  15.             parent = arg(1)
  16.             argCount = argCount - 1
  17.             argOff = 1
  18.         end
  19.     end
  20.     InitArgs.0 = argCount
  21.     if( argCount > 0 )then do i = 1 to argCount
  22.         InitArgs.i = arg( i + argOff )
  23.     end
  24.     drop calledAs argCount argOff
  25.  
  26. /*  Load the windows
  27. */
  28.     call VRInit
  29.     parse source . . spec
  30.     _VREPrimaryWindowPath = ,
  31.         VRParseFileName( spec, "dpn" ) || ".VRW"
  32.     _VREPrimaryWindow = ,
  33.         VRLoad( parent, _VREPrimaryWindowPath )
  34.     drop parent spec
  35.     if( _VREPrimaryWindow == "" )then do
  36.         call VRMessage "", "Cannot load window:" VRError(), ,
  37.             "Error!"
  38.         _VREReturnValue = 32000
  39.         signal _VRELeaveMain
  40.     end
  41.  
  42. /*  Process events
  43. */
  44.     call Init
  45.     signal on halt
  46.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  47.         _VREEvent = VREvent()
  48.         interpret _VREEvent
  49.     end
  50. _VREHalt:
  51.     _VREReturnValue = Fini()
  52.     call VRDestroy _VREPrimaryWindow
  53. _VRELeaveMain:
  54.     call VRFini
  55. exit _VREReturnValue
  56.  
  57. VRLoadSecondary: procedure
  58.     name = arg( 1 )
  59.  
  60.     window = VRLoad( VRWindow(), VRWindowPath(), name )
  61.     call VRMethod window, "CenterWindow"
  62.     call VRSet window, "Visible", 1
  63.     call VRMethod window, "Activate"
  64. return window
  65.  
  66. /*:VRX         Fini
  67. */
  68. Fini:
  69.     window = VRWindow()
  70.     call VRSet window, "Visible", 0
  71.     drop window
  72. return retcode
  73.  
  74. /*:VRX         Halt
  75. */
  76. Halt:
  77.     signal _VREHalt
  78. return
  79.  
  80. /*:VRX         Init
  81. */
  82. Init:
  83.     ok = VRSet( "EF_1", "Value", InitArgs.2)
  84.         
  85.  /*   ok = VRSet( "EF_2", "Value", InitArgs.3)
  86.     ok = VRSet( "EF_3", "Value", InitArgs.4)
  87.     ok = VRSet( "EF_4","Value","C:\VSECOM\LISTS\RESULTS") */
  88.  
  89.     if InitArgs.1 = "LIB" then do
  90.     ok = VRSet( "Window2", "Caption", "LIBR LIBRARY LISTING")
  91.     ok = VRSet( "EF_2", "Enabled", 0)
  92.     ok = VRSet( "EF_2", "Visible", 0)
  93.     ok = VRSet( "EF_3", "Enabled", 0)
  94.     ok = VRSet( "EF_3", "Visible", 0)
  95.     ok = VRSet( "EF_4","Value",InitArgs.3||"\LIBLIST")
  96.     end
  97.  
  98.     memparm = LEFT(InitArgs.1,3)
  99.     if memparm = "SUB" then do
  100.     ok = VRSet( "EF_2", "Value", InitArgs.4)
  101.     ok = VRSet( "EF_2", "Enabled", 1)
  102.     ok = VRSet( "EF_2", "Visible", 1)
  103.     ok = VRSet( "EF_3", "Enabled", 0)
  104.     ok = VRSet( "EF_3", "Visible", 0)
  105.     end
  106.     if InitArgs.1 = "SUBL" then do
  107.     ok = VRSet( "Window2", "Caption", "LIBR SUBLIB LIST")
  108.     ok = VRSet( "EF_4","Value",InitArgs.3||"\SUBLIST")
  109.     end
  110.     if InitArgs.1 = "SUBD" then do
  111.     ok = VRSet( "Window2", "Caption", "LIBR DELETE SUBLIB")
  112.     ok = VRSet( "EF_4","Value",InitArgs.3||"\DELLIST")
  113.     end
  114.     if InitArgs.1 = "SUBC" then do
  115.     ok = VRSet( "Window2", "Caption", "LIBR CREATE SUBLIB")
  116.     ok = VRSet( "EF_4","Value",InitArgs.3||"\MAKELIST")
  117.  
  118.     end
  119.  
  120.     if memparm = "MEM" then do
  121.     ok = VRSet( "EF_2", "Value", InitArgs.4)
  122.         ok = VRSet( "EF_2", "Enabled", 1)
  123.     ok = VRSet( "EF_2", "Visible", 1)
  124.     ok = VRSet( "EF_3", "Value","*.*????")
  125.     ok = VRSet( "EF_3", "Enabled", 1)
  126.     ok = VRSet( "EF_3", "Visible", 1)
  127.     end
  128.     if InitArgs.1 = "MEML" then do
  129.     ok = VRSet( "Window2", "Caption", "LIBR MEMBER(S) LIST")
  130.     ok = VRSet( "EF_4","Value",InitArgs.3||"\MEMLIST")
  131.     end
  132.     if InitArgs.1 = "MEMD" then do
  133.     ok = VRSet( "Window2", "Caption", "LIBR DELETE MEMBER(S)")
  134.     ok = VRSet( "EF_4","Value",InitArgs.3||"\DELLIST")
  135.     end
  136.  
  137.  
  138.  /*   if InitArgs.1 = "LOCK" then do
  139.     ok = VRSet( "Window2", "Caption", "LOCK MEM INPUT")
  140.     ok = VRSet( "EF_2", "Enabled", 1)
  141.     ok = VRSet( "EF_2", "Visible", 1)
  142.     ok = VRSet( "EF_3", "Enabled", 1)
  143.     ok = VRSet( "EF_3", "Visible", 1)
  144.     ok = VRSet( "CB_3", "Visible", 1)
  145.     end
  146.  
  147.       if InitArgs.1 = "UNLOCK" then do
  148.     ok = VRSet( "Window2", "Caption", "UNLOCK MEM INPUT")
  149.     ok = VRSet( "EF_2", "Enabled", 1)
  150.     ok = VRSet( "EF_2", "Visible", 1)
  151.     ok = VRSet( "EF_3", "Enabled", 1)
  152.     ok = VRSet( "EF_3", "Visible", 1)
  153.     ok = VRSet( "CB_4", "Visible", 1)
  154.     end
  155.     
  156.       if InitArgs.1 = "UPLOAD" then do
  157.     ok = VRSet( "Window2", "Caption", "UPLOAD MEM INPUT")
  158.     ok = VRSet( "EF_2", "Enabled", 1)
  159.     ok = VRSet( "EF_2", "Visible", 1)
  160.     ok = VRSet( "EF_3", "Enabled", 1)
  161.     ok = VRSet( "EF_3", "Visible", 1)
  162.     ok = VRSet( "CB_5", "Visible", 1)
  163.     end
  164.  
  165.       if InitArgs.1 = "DOWNLOAD" then do
  166.     ok = VRSet( "Window2", "Caption", "DOWNLOAD MEM INPUT")
  167.     ok = VRSet( "EF_2", "Enabled", 1)
  168.     ok = VRSet( "EF_2", "Visible", 1)
  169.     ok = VRSet( "EF_3", "Enabled", 1)
  170.     ok = VRSet( "EF_3", "Visible", 1)
  171.     ok = VRSet( "CB_6", "Visible", 1)
  172.     end */
  173.  
  174.  
  175.     if InitArgs.1 = "SEARCH" then do
  176.     ok = VRSet( "Window2", "Caption", "LIBR SEARCH OPEN LIBS")
  177.     ok = VRSet( "EF_1", "Value", "*")
  178.     ok = VRSet( "EF_2", "Enabled", 0)
  179.     ok = VRSet( "EF_2", "Visible", 0)
  180.     ok = VRSet( "EF_3", "Value", "FIND??.*")
  181.     ok = VRSet( "EF_3", "Enabled", 1)
  182.     ok = VRSet( "EF_3", "Visible", 1)
  183.     ok = VRSet( "EF_4","Value",InitArgs.3||"\FINDLIST")
  184.     end
  185.  
  186.  /*   if InitArgs.1 = "SUBMIT" then do
  187.     ok = VRSet( "Window2", "Caption", "SUBMIT JCL FROM PC")
  188.     ok = VRSet( "EF_1", "Enabled", 0)
  189.     ok = VRSet( "EF_1", "Visible", 0)
  190.     ok = VRSet( "EF_2", "Enabled", 0)
  191.     ok = VRSet( "EF_2", "Visible", 0)
  192.     ok = VRSet( "EF_3", "Enabled", 0)
  193.     ok = VRSet( "EF_3", "Visible", 0)
  194.     ok = VRSet( "CB_7", "Visible", 1)
  195.     ok = VRSet( "EF_4","Value","C:\VSECOM\JOBS\JOBNAME")
  196.     end */
  197.  
  198.  
  199.     Retcode = ""
  200.     window = VRWindow()
  201.     call VRMethod window, "CenterWindow"
  202.     call VRSet window, "Visible", 1
  203.     call VRMethod window, "Activate"
  204.     drop window
  205. return
  206.  
  207. /*:VRX         PB_2_Click
  208. */
  209. PB_2_Click:
  210.     LIB = VRGet( "EF_1", "Value")
  211.     SUB = VRGet( "EF_2", "Value")
  212.     MEMNAME = VRGet( "EF_3", "Value")
  213.     LIBFILE = VRGet( "EF_4", "Value")
  214.     CHKVIEW = VRGet( "CB_1", "Set")
  215.     CHKPRT = VRGet( "CB_2", "Set")
  216.     ok = VRSet( "EF_1", "Enabled", 1)
  217.     ok = VRSet( "EF_1", "Visible", 1)
  218.    
  219.     Retcode = CHKPRT||","||CHKVIEW||","||LIBFILE","LIB||","||SUB","MEMNAME
  220.     call Quit
  221. return 
  222. /*:VRX         PB_3_Click
  223. */
  224. PB_3_Click:
  225.     call Quit
  226. return
  227.  
  228. /*:VRX         Quit
  229. */
  230. Quit:
  231.     window = VRWindow()
  232.     call VRSet window, "Shutdown", 1
  233.     drop window
  234. return
  235.  
  236. /*:VRX         Window2_Close
  237. */
  238. Window2_Close:
  239.     call Quit
  240. return
  241.  
  242.