home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vsecom3.zip / WINDOW14.VRX < prev    next >
Text File  |  1994-12-15  |  4KB  |  183 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. if InitArgs.1 = "SEND" then do
  84.     ok = VRSet( "DT_5", "CAPTION", "COPY FROM:")
  85.     ok = VRSet( "DT_6", "CAPTION", "COPY TO:")
  86. end
  87. if InitArgs.1 = "REC" then do
  88.     ok = VRSet( "DT_5", "CAPTION", "COPY TO:")
  89.     ok = VRSet( "DT_6", "CAPTION", "COPY FROM:")
  90. end
  91.  
  92.    window = VRWindow()
  93.     call VRMethod window, "CenterWindow"
  94.     call VRSet window, "Visible", 1
  95.     call VRMethod window, "Activate"
  96.     drop window
  97.  
  98.  
  99. return
  100.  
  101. /*:VRX         PB_1_Click
  102. */
  103. PB_1_Click:
  104. retcode = ""
  105. EF_1 = VRGet("EF_1","Value")
  106. EF_2 = VRGet("EF_2","Value")
  107. EF_3 = VRGet("EF_3","Value")
  108. EF_4 = VRGet("EF_4","Value")
  109. EF_5 = VRGet("EF_5","Value")
  110. EF_6 = VRGet("EF_6","Value")
  111. part1 = EF_1
  112. part2 = EF_4||" "||EF_5||" ( FILE=LIB"
  113. opts = ""
  114. nowopt = ""
  115. ok = VRGet("RB_2","Set")
  116.     if ok = "1" then do
  117.     nowopt = "BINARY"
  118.     opts = nowopt
  119.     nowopt = ""
  120.     end
  121. ok = VRGet("RB_3","Set")
  122.     if ok = "1" then do
  123.     nowopt = "NOCRLF"
  124.     opts = opts||" "||nowopt
  125.     nowopt = ""
  126.     end
  127. nowopt ="L="||EF_2||" "||"S="||EF_3
  128. opts = opts||" "||nowopt
  129. nowopt = ""
  130. ok = VRGet("CB_2","Set")
  131.     if ok = "1" then do
  132.     nowopt = "UC"
  133.     opts = opts||" "||nowopt
  134.     nowopt = ""
  135.     end
  136. ok = VRGet("CB_4","Set")
  137.     if ok = "1" then do
  138.     nowopt = "REPLACE"
  139.     opts = opts||" "||nowopt
  140.     nowopt = " "
  141.     end
  142. opts = opts||" "||nowopt
  143.     nowopt = " "
  144. ok = VRGet("CB_3","Set")
  145.     if ok = "1" then do
  146.     nowopt = "DATA=YES"
  147.     opts = opts||" "||nowopt
  148.     nowopt = ""
  149.     end
  150. ok = VRGet("CB_1","Set")
  151.     if ok = "1" then do
  152.     nowopt = "TRACE=LST"
  153.     opts = opts||" "||nowopt
  154.     nowopt = ""
  155.     end
  156.  
  157. opts = opts||" "||EF_6
  158. retcode = part1||","||part2||","||opts
  159. call Quit
  160. return
  161.  
  162. /*:VRX         PB_2_Click
  163. */
  164. PB_2_Click:
  165. retcode = ""
  166. call Quit
  167. return
  168.  
  169. /*:VRX         Quit
  170. */
  171. Quit:
  172.     window = VRWindow()
  173.     call VRSet window, "Shutdown", 1
  174.     drop window
  175. return
  176.  
  177. /*:VRX         Window5_Close
  178. */
  179. Window5_Close:
  180.     call Quit
  181. return
  182.  
  183.