home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vprupd.zip / update.inf (.txt)
OS/2 Help File  |  1993-10-11  |  14KB  |  337 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. VisPro/REXX Version 1.1 (8/93) 
  5.  
  6. by HockWare Inc. 
  7.  
  8. This online book is a summary of the changes in VisPro/REXX for Version 1.1, 
  9. from Version 1.0. 
  10.  
  11. For Support details double click here. 
  12.  
  13.  
  14. ΓòÉΓòÉΓòÉ 1.1. Support ΓòÉΓòÉΓòÉ
  15.  
  16. For technical support questions call the following numbers: 
  17.  
  18. o Technical support FAX line: (919) 380-0757 
  19. o Technical support line: (919) 380-0616 
  20. o Compuserve ID: 71333,3226 
  21. o Technical support can also be obtained through COMPUSERVE in the HockWare 
  22.   forum (section 8) within the OS/2 Vendors Forum (OS2AVEN) 
  23.  
  24. Note:  The HockWare sales line is (919) 387-7391 
  25.  
  26.  
  27. ΓòÉΓòÉΓòÉ 2. Who should receive this update ΓòÉΓòÉΓòÉ
  28.  
  29. This product update was has been issued to all of registered VisPro/REXX 1.0 
  30. users.  In contains a number of important enhancements (listed below). 
  31.  
  32.  
  33. ΓòÉΓòÉΓòÉ 3. How to apply the update ΓòÉΓòÉΓòÉ
  34.  
  35. You must have VisPro/REXX installed in your machine before applying the changes 
  36. in this update. 
  37.  
  38. If you have already installed VisPro/REXX, you can easily apply the changes 
  39. within this disk by using the UPDATE command, included in this disk. 
  40.  
  41. The UPDATE command will copy the files that need to be modified on your hard 
  42. drive.  After the files are copied, you can start using VisPro/REXX right away. 
  43.  
  44.  
  45. ΓòÉΓòÉΓòÉ 4. What does this update contain? ΓòÉΓòÉΓòÉ
  46.  
  47. The enhancements in this update are: 
  48.  
  49. o Easy Multithreading 
  50. o Stdio Support 
  51. o Easier Starting of Commands 
  52.  
  53.  
  54. ΓòÉΓòÉΓòÉ 4.1. Easy Multithreading ΓòÉΓòÉΓòÉ
  55.  
  56. All REXX statements are executed in a thread which is different from the user 
  57. interface thread.  As a result of this, the user interface will remain 
  58. responsive even if the application is still processing an event. You don't need 
  59. to modify your programs to get this enhancement, all you need to do is to 
  60. rebuild. 
  61.  
  62.  
  63. ΓòÉΓòÉΓòÉ 4.2. Stdio Support ΓòÉΓòÉΓòÉ
  64.  
  65. If your REXX statements write something to the standard output or try to read 
  66. from the standard input, this will now be handled by the display of a STDIO 
  67. (Standard Input Output) Window.  If you wish to see how this works, just place 
  68. a statement which produces standard output, such as 'DIR' on an event. 
  69.  
  70. When your program is reading from the standard input, it will wait until input 
  71. has been entered by the user on the STDIO Window. 
  72.  
  73.  
  74. ΓòÉΓòÉΓòÉ 4.3. Easier Starting Of Commands ΓòÉΓòÉΓòÉ
  75.  
  76. Invoking other programs within VisPro/REXX is a snap.  Just place the program 
  77. invocation you wish to use, just like you would in a command line within 
  78. quotations.  For instance, invoking the system editor could be done as follows: 
  79.  
  80.      'E C:\CONFIG.SYS'
  81.  
  82.      or
  83.  
  84.      'START E C:\CONFIG.SYS'
  85.  
  86. Both invocations above are similar.  However, the first invocation starts the 
  87. system editor and does not continue processing any further REXX statements 
  88. until the editor has completed.  The second invocation starts the system editor 
  89. and immediately proceeds with the rest of the REXX statements in the current 
  90. event. 
  91.  
  92. You may also want to try using the REXX 'ADDRESS' command, which would produce 
  93. similar results. 
  94.  
  95.  
  96. ΓòÉΓòÉΓòÉ 5. New information not covered in the book ΓòÉΓòÉΓòÉ
  97.  
  98.  1. Multithreading of REXX Code 
  99.  2. STDIO window 
  100.  
  101.  
  102. ΓòÉΓòÉΓòÉ 5.1. Multithreading of REXX Code ΓòÉΓòÉΓòÉ
  103.  
  104. All REXX code is now invoked in a thread which is different from the user 
  105. interface thread.  This allows the user interface to be responsive at all 
  106. times, even if some prior event is still being handled in REXX. 
  107.  
  108. If an event is going to take a long time, it is recommended that the user is 
  109. given some indication that the program has not completed handling the event. 
  110. An easy way of doing this is by changing the mouse pointer to the hourglass and 
  111. then changing it back to normal when the processing is done.  Another way of 
  112. doing this is to disable the action buttons within the dialog, and to reenable 
  113. them when the operation taking a long time has completed. 
  114.  
  115.  
  116. ΓòÉΓòÉΓòÉ 5.2. STDIO Window ΓòÉΓòÉΓòÉ
  117.  
  118. If an application needs to write to the standard output or read from the 
  119. standard input, it will use the STDIO window to accomplish this.  Within this 
  120. window, a user will be able to see the output and be able to type input data. 
  121.  
  122. The STDIO window is provided as a way of transitioning existing REXX programs 
  123. to VisPro/REXX.  Once an application has been finished, you should have 
  124. modified your REXX statements so they don't use this facility, and instead use 
  125. standard Presentation Manager controls to show the information graphically. 
  126. This is not a requirement, of course, as you may choose to use the STDIO window 
  127. as part of your completed application. 
  128.  
  129. When something is written to the standard output, the STDIO Window will 
  130. automatically appear and will display output information.  Once this window has 
  131. been made visible, it will remain visible while the program is running. 
  132.  
  133. If your program is going to do a read from the standard input, you need to make 
  134. certain that the STDIO window is already displayed.  An easy way of doing this 
  135. is to output a blank line to standard output. 
  136.  
  137. Once the STDIO window is displayed, it may be minimized or hidden (depending on 
  138. the user's OS/2 settings), but it may not be closed.  This is done in order to 
  139. prevent the user from closing the STDIO window when the application requires 
  140. standard input. 
  141.  
  142. The STDIO window will automatically close when the application ends. 
  143.  
  144. Note:  If you want to prevent standard output and standard error output from 
  145. being placed on the STDIO window when invoking OS/2 commands you can simply 
  146. redirect this output to a file or to the NUL file, as follows: 
  147.  
  148.             'copy c:\config.sys d:\config.bak 1>NUL 2>NUL'
  149.  
  150. After the preceding statement is executed the value in the RC variable will 
  151. contain 0 if the statement executed correctly. 
  152.  
  153. Note:  For more information on redirection, refer to OS/2 documentation. 
  154.  
  155.  
  156. ΓòÉΓòÉΓòÉ 6. Additional information not covered in the book ΓòÉΓòÉΓòÉ
  157.  
  158.  1. Using the toolbar 
  159.  2. Return codes in a when closed event 
  160.  3. Working out the screen resolution 
  161.  4. Changing the pointer 
  162.  5. Global Variables 
  163.  6. SubProcs 
  164.  7. Secondary Forms 
  165.  8. The TOPIC variable 
  166.  9. Get Item Count call 
  167. 10. Add items at an index 
  168. 11. Starting other applications 
  169.  
  170.  
  171. ΓòÉΓòÉΓòÉ 6.1. Using the toolbar ΓòÉΓòÉΓòÉ
  172.  
  173. Another handy way of using the toolbar is to drag the object right off the tool 
  174. bar.  This allows you to drag an object onto the canvas without changing the 
  175. toolbar selection. 
  176.  
  177.  
  178. ΓòÉΓòÉΓòÉ 6.2. When closed event information ΓòÉΓòÉΓòÉ
  179.  
  180. When handling a "When closed" event for a form, a return of 1 will cause the 
  181. window not to be closed. 
  182.  
  183.  
  184. ΓòÉΓòÉΓòÉ 6.3. Screen Size ΓòÉΓòÉΓòÉ
  185.  
  186. To get the size of the screen, you can use the VpWindow call with the 
  187. 'GETSCREENSIZE' argument.  The following example shows how to get the screen 
  188. size and set the current window according to this size: 
  189.  
  190.    xy=VpWindow(window,'GETSCREENSIZE')
  191.    PARSE VAR xy x y
  192.    CALL VpWindow window,'SETPOS', 0, 0, x, y
  193.  
  194.  
  195. ΓòÉΓòÉΓòÉ 6.4. Changing the pointer ΓòÉΓòÉΓòÉ
  196.  
  197. Changing the pointer value can be done with the VpWindow call with the 
  198. 'SETPOINTER' argument.  The third parameter is the value of the pointer 
  199. picture.  The following example shows how to change the mouse pointer to the 
  200. hourglass: 
  201.  
  202.    /* valid index 1 - 22 */
  203.    value = VpLoadPicture('SYSICON',3)
  204.    CALL VpWindow window,'SETPOINTER',value
  205.  
  206. Here is how to set it back to the normal pointer: 
  207.  
  208.    /* valid index 1 - 22 */
  209.    value = VpLoadPicture('SYSICON',1)
  210.    CALL VpWindow window,'SETPOINTER',value
  211.  
  212. You should set the pointer to the hourglass whenever you have some time 
  213. intensive operations to perform.  This will give the user an indication of the 
  214. fact that the program is not expecting input from the user at the time. 
  215.  
  216.  
  217. ΓòÉΓòÉΓòÉ 6.5. Global Variables ΓòÉΓòÉΓòÉ
  218.  
  219. Global variable values are scoped to the form in which they are defined. This 
  220. means that if a variable is defined on a secondary form it will not be 
  221. available on the primary form.  Further, if the same variable is defined on the 
  222. primary and secondary forms, these variables are treated as if they where 
  223. different. 
  224.  
  225.  
  226. ΓòÉΓòÉΓòÉ 6.6. Subroutines ΓòÉΓòÉΓòÉ
  227.  
  228. o When adding subroutines to a SubProcs folder, make certain that the file does 
  229.   not have an extension. 
  230. o All subroutines within the SubProcs folder will be included as part of the 
  231.   resulting .EXE file when doing a build. 
  232.  
  233.  
  234. ΓòÉΓòÉΓòÉ 6.7. Secondary Forms ΓòÉΓòÉΓòÉ
  235.  
  236. As mentioned in page 98, secondary forms are created by using the VpOpenForm 
  237. call.  The VpOpenForm call normally looks as follows: 
  238.  
  239.    value=VpOpenForm(window, 257, 'topic name')
  240.  
  241. Where: 
  242.  
  243.  1. Window - is the window handle of the form which will be the parent of the 
  244.     newly created window 
  245.  2. 257 - is a generated unique identifier for the secondary window to be 
  246.     created.  Do not change this generated value 
  247.  3. 'topic name' - is a customizable argument which is passed to the secondary 
  248.     form.  Within the secondary form, this argument value can be obtained by 
  249.     using the TOPIC variable.  See the next item for more information on the 
  250.     TOPIC variable. 
  251.  
  252.  
  253. ΓòÉΓòÉΓòÉ 6.8. TOPIC Variable ΓòÉΓòÉΓòÉ
  254.  
  255. The TOPIC variable is a special variable which contains parameter information 
  256. passed in when the form is created.  This variable doesn't need to be declared 
  257. in the global variables page, but rather it is always available within a form. 
  258. In the case of the primary form, TOPIC contains command line arguments passed 
  259. in when the program is invoked. For more information on this variable refer to 
  260. the Online help or the User's Guide. 
  261.  
  262.  
  263. ΓòÉΓòÉΓòÉ 6.9. Get Item Count call ΓòÉΓòÉΓòÉ
  264.  
  265. To query the number of items in a ListBox, combo box, or container control you 
  266. can use the VpGetItemCount function.  This REXX statement for this function is 
  267. as follows: 
  268.  
  269.    value = VpGetItemCount( window, ITEMID)
  270.  
  271. After executing this function, value will contain the number of items in the 
  272. list or container. 
  273.  
  274.  
  275. ΓòÉΓòÉΓòÉ 6.10. Add item at index ΓòÉΓòÉΓòÉ
  276.  
  277. To add an item to a listbox or combo box at a specific index use the VpAddItem 
  278. call as follows: 
  279.  
  280.    CALL VpAddItem window, ITEMID, index, value
  281.  
  282. Where index is a number specifying the index where the item will be inserted, 
  283. and value is the value to be added. 
  284.  
  285.  
  286. ΓòÉΓòÉΓòÉ 6.11. Starting other applications ΓòÉΓòÉΓòÉ
  287.  
  288. To start another application, you can use standard REXX conventions and include 
  289. the application invocation within quotations, or use the START command within 
  290. quotations.  If you require more control over these mechanisms, you can use the 
  291. VpStart function.  VpStart has the following syntax: 
  292.  
  293.    applicationid=VpStart(window, arg2,arg3,arg4....)
  294.  
  295. Where: 
  296.  
  297. o Arg2 - "APP"   - Start an application 
  298.  
  299.   Note:  The form starting the VpStart will get a CLOSE NOTIFY form event when 
  300.   the application ends. In this event the FROMTOPIC variable will contain the 
  301.   applicationid followed by the return code from the application. 
  302. o Arg2 - "SESSION" - Start an application in a separate session 
  303. o Arg3 - Fully qualified program path 
  304. o Arg4 - Parameter string (optional) 
  305. o Arg5 - Title (optional) 
  306. o Arg6 - Option string (optional) 
  307.  
  308.    - -I   Inherit environment from main OS/2 process.  This means that the 
  309.      program would have the environment given in the CONFIG.SYS file.  This 
  310.      option is only valid if using the "SESSION" option. This is required for 
  311.      stdin/stdout to function properly 
  312.    - -FS  Start in full screen 
  313.    - -DOS  Start a DOS session 
  314.    - -MAX  Start maximized 
  315.    - -MIN  Start minimized 
  316.    - -HIDE Start hidden 
  317.    - -B   Start in background 
  318.    - -C   Start as child process 
  319.  
  320. o Arg7, Arg8, Arg9, Arg10 
  321.  
  322.   Initial position and size of the application (optional) 
  323.  
  324.   Arg7 is the x coordinate, Arg8 is the y coordinate 
  325.  
  326.   Arg9 is the xsize, and Arg10 is the ysize. 
  327.  
  328.   If these arguments are not provided, OS/2 will define the placement and size 
  329.   of the application. 
  330. o Arg11, and all arguments provided afterwards (optional) 
  331.  
  332.   Environment strings passed to the application. 
  333.  
  334. The following is an example of using the VpStart command: 
  335.  
  336.    applicationid=VpStart(window,"APP", 'c:\os2\e.exe','temp.txt')
  337.