home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 7 / POWERCD7.ISO / os2 / etelr212 / etprerec.vrm < prev    next >
Text File  |  1994-09-13  |  6KB  |  253 lines

  1. /* Custom mainline for macro */
  2.  
  3.     call RXFuncAdd "VRLoadFuncs", "VROBJ", "VRLoadFuncs"
  4.     call VRLoadFuncs
  5.  
  6.     _VREVersion = SubWord( VRVersion( "VRObj" ), 1, 1 )
  7.     if( _VREVersion < 2.10 )then do
  8.         call VRMessage "", "This program requires VX-REXX version 2.1 to run.", "Error!"
  9.         return 32000
  10.     end
  11.  
  12.     signal on SYNTAX name _VRESyntax
  13.     signal _VREMain
  14.  
  15. _VRESyntax:
  16.     parse source . . _VRESourceSpec
  17.     call VRMessage "", "Syntax error in" _VRESourceSpec "line" SIGL":" ErrorText(rc), "Error!"
  18.     call VRFini
  19.     exit 32000
  20.  
  21. _VREMain:
  22. /*:VRX         Main
  23. */
  24. /*  Main
  25. */
  26. Main:
  27. /*  Process the arguments.
  28.     Get the parent window.
  29. */
  30.     parse source . calledAs .
  31.     parent = ""
  32.     argCount = arg()
  33.     argOff = 0
  34.     if( calledAs \= "COMMAND" )then do
  35.         if argCount >= 1 then do
  36.             parent = arg(1)
  37.             argCount = argCount - 1
  38.             argOff = 1
  39.         end
  40.     end
  41.     InitArgs.0 = argCount
  42.     if( argCount > 0 )then do i = 1 to argCount
  43.         InitArgs.i = arg( i + argOff )
  44.     end
  45.     drop calledAs argCount argOff
  46.  
  47. /*  Load the windows
  48. */
  49.     call VRInit
  50.     parse source . . spec
  51.     _VREPrimaryWindowPath = ,
  52.         VRParseFileName( spec, "dpn" ) || ".VRW"
  53.     _VREPrimaryWindow = ,
  54.         VRLoad( parent, _VREPrimaryWindowPath )
  55.     drop parent spec
  56.     if( _VREPrimaryWindow == "" )then do
  57.         call VRMessage "", "Cannot load window:" VRError(), ,
  58.             "Error!"
  59.         _VREReturnValue = 32000
  60.         signal _VRELeaveMain
  61.     end
  62.  
  63. /*  Process events
  64. */
  65.     call Init
  66.     signal on halt
  67.     do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
  68.         _VREEvent = VREvent()
  69.         interpret _VREEvent
  70.     end
  71. _VREHalt:
  72.     _VREReturnValue = Fini()
  73.     call VRDestroy _VREPrimaryWindow
  74. _VRELeaveMain:
  75.     call VRFini
  76. exit _VREReturnValue
  77.  
  78. VRLoadSecondary: procedure
  79.     name = arg( 1 )
  80.  
  81.     window = VRLoad( VRWindow(), VRWindowPath(), name )
  82.     call VRMethod window, "CenterWindow"
  83.     call VRSet window, "Visible", 1
  84.     call VRMethod window, "Activate"
  85. return window
  86.  
  87. /*:VRX         EFEnding_GotFocus
  88. */
  89. EFEnding_GotFocus:
  90. call VRSet 'EFEnding', 'SelectedStart', 1, 'SelectedEnd', Length( VRGet( 'EFEnding', 'Value' ) ) + 1
  91. return
  92.  
  93. /*:VRX         EFEnding_LostFocus
  94. */
  95. EFEnding_LostFocus:
  96. value = VRGet( 'EFEnding', 'Value' )
  97. if value = '' then
  98.     return
  99. call iStrip value' STRIP'
  100. if( Datatype( value ) <> 'NUM' )then do
  101.     call VRMessage VRWindow(), 'Non-numeric amount not supported.  ', 'Information'
  102.     return
  103. end
  104. call iFormat value
  105. call VRSet 'EFEnding', 'Value', value
  106. return
  107.  
  108. /*:VRX         EFFees_GotFocus
  109. */
  110. EFFees_GotFocus:
  111. call VRSet 'EFFees', 'SelectedStart', 1, 'SelectedEnd', Length( VRGet( 'EFFees', 'Value' ) ) + 1
  112. return
  113.  
  114. /*:VRX         EFFees_LostFocus
  115. */
  116. EFFees_LostFocus:
  117. value = VRGet( 'EFFees', 'Value' )
  118. if value = '' then
  119.     return
  120. call iStrip value' STRIP'
  121. if( Datatype( value ) <> 'NUM' )then do
  122.     call VRMessage VRWindow(), 'Non-numeric amount not supported.  ', 'Information'
  123.     return
  124. end
  125. call iFormat value
  126. call VRSet 'EFFees', 'Value', value
  127. return
  128.  
  129. /*:VRX         EFInterest_GotFocus
  130. */
  131. EFInterest_GotFocus:
  132. call VRSet 'EFInterest', 'SelectedStart', 1, 'SelectedEnd', Length( VRGet( 'EFInterest', 'Value' ) ) + 1
  133. return
  134.  
  135. /*:VRX         EFInterest_LostFocus
  136. */
  137. EFInterest_LostFocus:
  138. value = VRGet( 'EFInterest', 'Value' )
  139. if value = '' then
  140.     return
  141. call iStrip value' STRIP'
  142. if( Datatype( value ) <> 'NUM' )then do
  143.     call VRMessage VRWindow(), 'Non-numeric amount not supported.  ', 'Information'
  144.     return
  145. end
  146. call iFormat value
  147. call VRSet 'EFInterest', 'Value', value
  148. return
  149.  
  150. /*:VRX         Fini
  151. */
  152. Fini:
  153.     window = VRWindow()
  154.     call VRSet window, "Visible", 0
  155.     drop window
  156. return 0
  157.  
  158. /*:VRX         Halt
  159. */
  160. Halt:
  161.     signal _VREHalt
  162. return
  163.  
  164. /*:VRX         iFormat
  165. */
  166. iFormat:
  167. parse arg value
  168. call sformat value
  169. call VRMethod 'Application', 'GetVar', 'rc'
  170. value = rc
  171. return
  172.  
  173. /*:VRX         Init
  174. */
  175. Init:
  176.     call VRMethod 'Application', 'GetVar', 'args.'
  177.     Forward = args.1
  178.     Zero = args.2
  179.     tID = args.3
  180.     window = VRWindow()
  181.     call VRMethod window, "CenterWindow"
  182.     call VRSet window, "Visible", 1
  183.     call VRMethod window, "Activate"
  184.     drop window
  185. return
  186.  
  187. /*:VRX         iStrip
  188. */
  189. iStrip:
  190. parse arg value
  191. call sformat value
  192. call VRMethod 'Application', 'GetVar', 'rc'
  193. value = rc
  194. return
  195.  
  196. /*:VRX         PBCancel_Click
  197. */
  198. PBCancel_Click:
  199. call VRMethod 'Application', 'PostQueue', tID, 1, 'call ReturnFromReconciliation'
  200. call Quit
  201. return
  202.  
  203. /*:VRX         PBHelp_Click
  204. */
  205. PBHelp_Click:
  206. address cmd 'view e-teller Reconcile'
  207. return
  208.  
  209. /*:VRX         PBOK_Click
  210. */
  211. PBOK_Click:
  212. args.0 = 4
  213. args.1 = Forward
  214. args.2 = VRGet( 'EFEnding', 'Value' )
  215. args.3 = VRGet( 'EFInterest', 'Value' )
  216. args.4 = VRGet( 'EFFees', 'Value' )
  217. call VRMethod 'Application', 'PutVar', 'args.'
  218. call VRMethod 'Application', 'PostQueue', tID, 1, 'call Do_Reconcile'
  219. signal Quit
  220. return
  221.  
  222. /*:VRX         Quit
  223. */
  224. Quit:
  225.     drop args.
  226.     window = VRWindow()
  227.     call VRSet window, "Shutdown", 1
  228.     drop window
  229. return
  230.  
  231. /*:VRX         Window1_Close
  232. */
  233. Window1_Close:
  234.     call Quit
  235. return
  236.  
  237. /*:VRX         Window1_Create
  238. */
  239. Window1_Create:
  240. call VRSet 'DTForward', 'Caption', Forward
  241. call VRSet 'EFEnding', 'Value', Zero
  242. call VRSet 'EFInterest', 'Value', Zero
  243. call VRSet 'EFFees', 'Value', Zero
  244. drop Zero
  245. return
  246.  
  247. /*:VRX         Window1_Help
  248. */
  249. Window1_Help: 
  250. address cmd 'view e-teller Reconcile'
  251. return
  252.  
  253.