home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxlb.zip / RXWINDOW.INF (.txt) < prev   
OS/2 Help File  |  1994-02-07  |  28KB  |  839 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. RXWINDOW is a REXX function package that can help give your REXX programs a 
  5. text-mode window interface. It is designed for use in a full-screen or PM text 
  6. window session in OS/2. While it does not offer the usability advantages of a 
  7. GUI ("Graphical User Interface"), it is much easier for most users to program. 
  8. So it is well-suited for the common usage of REXX in prototyping and rapid 
  9. development. 
  10.  
  11. You can program the windows to allow for menu selection or user input of 
  12. multiple data fields. The functions provided are sufficient for implementing 
  13. many different styles of user interaction. 
  14.  
  15. In addition to going through the individual function descriptions in this 
  16. chapter, you should take a look at the example programs provided in the SAMPLES 
  17. subdirectory of the distribution disk. See SAMPLES.DOC for a list of the 
  18. pertinent sample programs. 
  19.  
  20. RXWINDOW software and documentation is Copyright (c) 1993-4 by Quercus Systems. 
  21. All rights reserved. 
  22.  
  23. RXWINDOW is a component of the Personal REXX and REXXLIB products of Quercus 
  24. Systems. It is commercial software, not Shareware. Except when included with 
  25. the REXXLIB demo package, every copy must be appropriately licensed from 
  26. Quercus Systems. Please do not copy without a license. 
  27.  
  28. For more information contact: 
  29.  
  30.    Quercus Systems
  31.    P. O. Box 2157
  32.    Saratoga, CA 95070
  33.  
  34.    Phone: (408) 867-7399
  35.    Fax:  (408) 867-7489
  36.    BBS:  (408) 867-7488
  37.  
  38.    Online support is available on CompuServe (GO QUERCUS)
  39.  
  40.  
  41. ΓòÉΓòÉΓòÉ 2. Registering RXWINDOW Functions ΓòÉΓòÉΓòÉ
  42.  
  43. RXWINDOW functions are contained in the RXWIN30.DLL file. To make the RXWINDOW 
  44. function package available to for use in your programs, you should first be 
  45. sure that RXWIN30.DLL is included in one of the directories in your OS/2 
  46. LIBPATH. This enables the system to locate the RXWINDOW function package when a 
  47. REXX program makes use of the functions it contains. 
  48.  
  49. Second, you have to register RXWINDOW functions with OS/2 by using the 
  50. RXFUNCADD() built-in function. The DLL name to use is RXWIN30, and the entry 
  51. point is RXWINDOW. This entry point is the same for all functions. A special 
  52. function called W_REGISTER() has been provided to make all the necessary 
  53. registration calls for you. There is a corresponding W_DEREGISTER() function 
  54. for deregistering all functions. Therefore, the following can be used to 
  55. properly register all functions: 
  56.  
  57. call rxfuncadd 'w_register', 'rxwin30', 'rxwindow'
  58. call w_register
  59.  
  60. The best time to do this is in a STARTUP.CMD file rather than in each REXX 
  61. program that uses RXWINDOW. 
  62.  
  63.  
  64. ΓòÉΓòÉΓòÉ 3. Windowing Functions Overview ΓòÉΓòÉΓòÉ
  65.  
  66. This section describes the windowing functions available when RXWINDOW is 
  67. loaded. The functions are divided into three groups: window control functions, 
  68. field-related functions, and other I/O functions. 
  69.  
  70.  
  71. ΓòÉΓòÉΓòÉ 3.1. Window Control Functions ΓòÉΓòÉΓòÉ
  72.  
  73. W_OPEN() 
  74.   Opens a new window and returns the window handle. 
  75.  
  76. W_CLOSE() 
  77.   Permanently closes a window and removes all related information. 
  78.  
  79. W_BORDER() 
  80.   Displays a border for a window. 
  81.  
  82. W_HIDE() 
  83.   Temporarily suppresses display or updating of a window. 
  84.  
  85. W_UNHIDE() 
  86.   Restores a previously "hidden" window. 
  87.  
  88. W_MOVE() 
  89.   Changes the screen position of a window. 
  90.  
  91. W_KEYS() 
  92.   Alters the behavior of cursor control keys and Enter key during a call to 
  93. W_READ. 
  94.  
  95. W_SIZE() 
  96.   Utility that returns the height and width of a window; analogous to the 
  97. SCRSIZE() function. 
  98.  
  99. W_ISWINDOW() 
  100.   Indicates whether a given handle represents a valid, currently open window. 
  101.  
  102.  
  103. ΓòÉΓòÉΓòÉ 3.2. Field-Oriented Functions ΓòÉΓòÉΓòÉ
  104.  
  105. W_FIELD() 
  106.   Defines a named input area within a window into which data can be entered. 
  107.  
  108. W_UNFIELD() 
  109.   Removes an input field from a window. 
  110.  
  111. W_READ() 
  112.   Reads user input from all currently defined input fields. 
  113.  
  114. W_ISFIELD() 
  115.   Indicates whether a given name is a field defined in a specified window. 
  116.  
  117. W_FIELDSET() 
  118.   Allows respecification of field characteristics such as screen attributes, 
  119. pad character, and protection status. 
  120.  
  121.  
  122. ΓòÉΓòÉΓòÉ 3.3. Other Window I/O Functions ΓòÉΓòÉΓòÉ
  123.  
  124. W_ATTR() 
  125.   Sets the screen attributes of a portion of a line in a window. 
  126.  
  127. W_CLEAR() 
  128.   Clears a window or a portion of a window; analogous to the SCRCLEAR() 
  129. function. 
  130.  
  131. W_GET() 
  132.   Reads user input from a specified input area in the window. 
  133.  
  134. W_PUT() 
  135.   Displays a character string in a window, with optional display attribute and 
  136. pad character. 
  137.  
  138. W_SCRPUT() 
  139.   Writes text and attributes to a window; analogous to the SCRPUT() function. 
  140.  
  141. W_SCRREAD() 
  142.   Reads text and attributes to a window; analogous to the SCRREAD() function. 
  143.  
  144. W_SCRWRITE() 
  145.   Writes text to a window; analogous to the SCRWRITE() function. 
  146.  
  147.  
  148. ΓòÉΓòÉΓòÉ 4. Full Function Descriptions ΓòÉΓòÉΓòÉ
  149.  
  150.  
  151. ΓòÉΓòÉΓòÉ 4.1. W_ATTR ΓòÉΓòÉΓòÉ
  152.  
  153. W_ATTR(window,row,col,length,attr) 
  154.  
  155. Sets the screen attributes of a portion of a line in a window. Always returns 
  156. 1. 
  157.  
  158. Window is the window handle as returned by W_OPEN. 
  159.  
  160. Row and col are the row and column numbers within the window at which the 
  161. string is to be written. (The upper left corner of the window is 1,1.) 
  162.  
  163. Length is the number of character positions affected. The output is truncated 
  164. at the right edge of the window and does not wrap around. 
  165.  
  166. Attr is the display attribute to be used. The default is as defined by the 
  167. W_OPEN call. 
  168.  
  169.  
  170. ΓòÉΓòÉΓòÉ 4.2. W_BORDER ΓòÉΓòÉΓòÉ
  171.  
  172. W_BORDER(window,[top],[right],[bottom],[left],[attr]) 
  173.  
  174. Displays a border for window. Always returns 1. 
  175.  
  176. Each side of the window may be defined separately as a double line (2), a 
  177. single line (1), or no lines (0). Specify top, right, bottom, and left as a 
  178. number from 0 to 2. The default for each is 2. 
  179.  
  180. Attr is the display attribute of the border. The default is as defined by the 
  181. W_OPEN call. 
  182.  
  183. You may change the border of a window at any time. Note that the border is 
  184. written within the window, on the first and last lines and in the first and 
  185. last columns. This means that you can write labels or other information on the 
  186. border. But it also means that character strings and data fields may 
  187. inadvertently extend into the border. 
  188.  
  189.  
  190. ΓòÉΓòÉΓòÉ 4.3. W_CLEAR ΓòÉΓòÉΓòÉ
  191.  
  192. W_CLEAR(window,[attr],[char],[row],[col],[height],[width]) 
  193.  
  194. Clears a window or a rectangular region within a window. The region can be 
  195. filled with any desired character and display attribute. Always returns 1. 
  196.  
  197. Window is the window handle as returned by W_OPEN. 
  198.  
  199. Attr is the display attribute to use in the cleared area. The default is as 
  200. defined by the W_OPEN call. 
  201.  
  202. Char is the character to fill in the area. The default is a blank. 
  203.  
  204. Row and col define the row and column within the window of the upper left 
  205. corner of the rectangular area. The default for each is 1. 
  206.  
  207. Height and width define the height and width of the area to be cleared. The 
  208. defaults are the number of rows and columns remaining in the window.  W_CLEAR 
  209. is analogous to the SCRCLEAR() function. 
  210.  
  211.  
  212. ΓòÉΓòÉΓòÉ 4.4. W_CLOSE ΓòÉΓòÉΓòÉ
  213.  
  214. W_CLOSE(window) 
  215.  
  216. Permanently closes window and removes all related information. The screen 
  217. contents under the window are restored to what they were before the window was 
  218. opened. Any input fields previously defined with W_FIELD are undefined. All 
  219. buffers and control blocks are released. Always returns 1. 
  220.  
  221. You should close a window as soon as you are finished with it in order to allow 
  222. room for other windows. 
  223.  
  224.  
  225. ΓòÉΓòÉΓòÉ 4.5. W_FIELD ΓòÉΓòÉΓòÉ
  226.  
  227. W_FIELD(window,field_name,row,col,length,[attr],[pad],[options],[subst]) 
  228.  
  229. Defines a named input area within a window into which data can be entered. 
  230. Returns 1 if successful, 0 if the field would be positioned outside the window. 
  231.  
  232. Window is the window handle as returned by W_OPEN. 
  233.  
  234. The data is read with the W_READ function. The field is not actually displayed 
  235. on the screen until W_READ is called. 
  236.  
  237. Field_name is the name assigned to the field. The same name should not be used 
  238. for different fields. Alphabetic case is ignored (even if field_name is 
  239. specified as a literal string, as it normally would be). This name is used to 
  240. associate both input and output data with a particular field via a REXX 
  241. variable of the same name. 
  242.  
  243. Row and col are the row and column numbers within the window at which the 
  244. string is to be written. (The upper left corner of the window is 1,1.) 
  245.  
  246. Length is the number of characters in the field. The field is truncated at the 
  247. right edge of the window and does not wrap around. 
  248.  
  249. Attr is the display attribute to be used. The default is as defined by the 
  250. W_OPEN call. 
  251.  
  252. Pad is the character to fill in the area. The default is a blank. 
  253.  
  254. Options specifies field options. It can be: 
  255.  
  256. N  (Non-protected), the default. The field is not protected against updates. 
  257.  
  258. P  (Protected). The field is protected against updates. When the cursor is 
  259.    moved with TAB or other keys, it will skip over protected fields. 
  260.  
  261. Subst specifies that a field should be hidden, and all characters entered in 
  262. the field from the keyboard should be displayed as the given substitute 
  263. character. This could be a space or any other character. If this argument is a 
  264. null string or omitted, the field will not be hidden. 
  265.  
  266. This function may fail if insufficient memory is available to store control 
  267. information, or if you accidentally define a field that falls outside of the 
  268. window.  If W_FIELD fails, a value of 0 will be returned. A value of 1 
  269. indicates successful operation. 
  270.  
  271.  
  272. ΓòÉΓòÉΓòÉ 4.6. W_FIELDSET ΓòÉΓòÉΓòÉ
  273.  
  274. W_FIELDSET(window,field_name,[attr],[pad],[options],[subst]) 
  275.  
  276. Allows respecification of field characteristics such as screen attributes, pad 
  277. character, and protection status. 
  278.  
  279. Window is the window handle as returned by W_OPEN. 
  280.  
  281. Field_name is the name assigned to the field in a call to W_FIELD. 
  282.  
  283. Attr is the display attribute to be used. The default is the current attribute 
  284. of the field. 
  285.  
  286. Pad is the character to fill in the area. The default is the current pad 
  287. character. 
  288.  
  289. Options specifies field options. It can be: 
  290.  
  291. N  (Non-protected). The field is not protected against updates. 
  292.  
  293. P  (Protected). The field is protected against updates. When the cursor is 
  294.    moved with TAB or other keys, it will skip over protected fields. 
  295.  
  296. Subst specifies that a field should be hidden, and all characters entered in 
  297. the field from the keyboard should be displayed as the given substitute 
  298. character. This could be a space or any other character. If this argument is a 
  299. null string or omitted, the field will not be hidden. 
  300.  
  301.  
  302. ΓòÉΓòÉΓòÉ 4.7. W_GET ΓòÉΓòÉΓòÉ
  303.  
  304. W_GET(window,row,col,length,[string],[attr],[pad],[activate]) 
  305.  
  306. Reads user input from a specified input area in a window and returns input 
  307. string. 
  308.  
  309. Window is the window handle as returned by W_OPEN. 
  310.  
  311. Row, col, and length specify the position and size of the input area.  This 
  312. area will be truncated if necessary at the right edge of the window; it does 
  313. not wrap around. 
  314.  
  315. String, if specified, defines the initial contents of the input area.  (Note: 
  316. The following characters should not be used as part of the value of string: 
  317. ASCII 0, ASCII 10 (line feed), ASCII 13 (carriage return), and ASCII 26 
  318. (end-of-file).) If no data is actually entered, this value will be returned. 
  319.  
  320. Attr is the display attribute to be used. The default is as defined by the 
  321. W_OPEN call. 
  322.  
  323. Pad characters may be used, either in addition to or instead of a display 
  324. attribute, in order to indicate visually the size of the field. Any pad 
  325. characters at the end of the string (but not elsewhere) are removed before the 
  326. value is returned. The default pad character is a blank. 
  327.  
  328. Activate determines which keys are used to indicate that data entry is 
  329. complete: 
  330.  
  331. N  (Normal), the default, means that only the Enter and Esc keys finish the 
  332.    operation. When Enter is pressed, the contents of the data field will be 
  333.    returned as a string. When Esc is pressed, a null string will be returned. 
  334.  
  335. F  (Function-keys) means that in addition to the Enter and Esc keys, function 
  336.    keys and other special keys (other than the editing keys described below) 
  337.    also end the operation. Any data entered will always be returned. 
  338.  
  339.    When W_GET is called, control does not return to the REXX program until data 
  340.    entry is complete. A code for the key that ended the operation will be 
  341.    placed in the REXX variable _ACTIVATION_KEY; this code is the same as 
  342.    provided by the INKEY function.  The name of the key that ended the 
  343.    operation is placed in the REXX variable _ACTIVATION_KEYNAME. 
  344.  
  345.    The key names that can be returned in _ACTIVATION_KEYNAME are: 
  346.  
  347.    ENTER 
  348.    ESC 
  349.    F1 ... F12 
  350.    S-F1 ... S-F12 
  351.    C-F1 ... C-F12 
  352.    A-F1 ... A-F12 
  353.    PGUP, PGDN 
  354.    OTHER (for any other activation key) 
  355.  
  356. Notes: 
  357.  
  358. o A number of editing keys are available for entering input while W_GET is 
  359.   active: 
  360.  
  361.    Backspace           delete character to the left of cursor 
  362.    Del                 delete character under the cursor 
  363.    Home                position cursor at start of input area 
  364.    End                 position cursor at end of input (excluding pad) 
  365.    Cursor Left         move cursor left 
  366.    Cursor Right        move cursor right 
  367.    Ctrl-End            delete from cursor to end of field 
  368.    Ctrl-Home           delete all characters in field 
  369.    Ctrl-Cursor Left    position cursor at start of previous word 
  370.    Ctrl-Cursor Right   position cursor at start of next word 
  371.    Ins                 toggle overtype/insert mode 
  372.  
  373. o When W_GET is called, overtype mode is in effect. It is indicated by a line 
  374.   cursor. A box cursor indicates insert mode. If you toggle modes with the Ins 
  375.   key, that mode remains in effect as long as the window is open or until Ins 
  376.   is pressed again. 
  377.  
  378. o Data entered is removed from the screen when W_GET returns. If you want data 
  379.   to remain displayed, you should call W_SCRWRITE to redisplay the data. 
  380.  
  381. o To avoid removal of trailing blanks in the input, specify a null character 
  382.   ('00'x) as the pad character. 
  383.  
  384. o W_GET is intended for reading a single data item at a time. If you want to 
  385.   enter several lines of data at a time, use W_FIELD to define the input fields 
  386.   and W_READ to read in the data. 
  387.  
  388.  
  389. ΓòÉΓòÉΓòÉ 4.8. W_HIDE ΓòÉΓòÉΓòÉ
  390.  
  391. W_HIDE(window,[option]) 
  392.  
  393. Temporarily inhibits the display of further data written to the window and 
  394. removes the window from the screen, making whatever was behind the window 
  395. visible. Optionally, the window can be left visible even though no further data 
  396. is displayed. Always returns 1. 
  397.  
  398. Window is the window handle as returned by W_OPEN. 
  399.  
  400. Option can be: 
  401.  
  402. A  (All), the default. All data in the window becomes invisible. 
  403.  
  404. N  (New). Only new data written to the window is invisible. This is useful for 
  405.    making multiple updates to a window without a "painting" effect being 
  406.    conspicuous. 
  407.  
  408.  
  409. ΓòÉΓòÉΓòÉ 4.9. W_ISFIELD ΓòÉΓòÉΓòÉ
  410.  
  411. W_ISFIELD(window,field_name) 
  412.  
  413. Indicates whether a given name is a field defined in a specified window. 
  414. Returns 1 if the field is defined, otherwise 0. 
  415.  
  416. Window is the window handle as returned by W_OPEN. 
  417.  
  418. Field_name is the name assigned to the field. 
  419.  
  420.  
  421. ΓòÉΓòÉΓòÉ 4.10. W_ISWINDOW ΓòÉΓòÉΓòÉ
  422.  
  423. W_ISWINDOW(window) 
  424.  
  425. Indicates whether a given handle represents a valid, currently open window. 
  426. Returns 1 if the window is open, otherwise 0. 
  427.  
  428. Window is the window handle as returned by W_OPEN. 
  429.  
  430.  
  431. ΓòÉΓòÉΓòÉ 4.11. W_KEYS ΓòÉΓòÉΓòÉ
  432.  
  433. W_KEYS(window,[tab_option],[enter_option],[keyboard_option]) 
  434.  
  435. Controls various aspects of cursor and keyboard operations with the W_GET and 
  436. W_READ functions for the specified window. Always returns 1. 
  437.  
  438. Window is the window handle as returned by W_OPEN. 
  439.  
  440. Tab_option can be either: 
  441.  
  442. J  (Jump) causes the cursor to automatically jump from one field to another 
  443.    when W_READ is used with multiple fields in a window. A jump occurs when a 
  444.    character is typed in the last position of a field, or when the Cursor Left 
  445.    or Cursor Right keys are used at the left or right end of the field. Word 
  446.    tab functions (Ctrl-Cursor Right and Ctrl-Cursor Left) also cause jumps 
  447.    between fields. 
  448.  
  449. N  (No jump) does not jump the cursor between fields except when the Cursor Up, 
  450.    Cursor Down, Tab, or Shift-Tab keys are used. This is the default. 
  451.  
  452. Enter_option affects how the Enter key behaves during a W_READ: 
  453.  
  454. A  (Any field) causes the Enter key to act as an activation key when the cursor 
  455.    is in any field. This is the default. 
  456.  
  457. L  (Last field) causes the Enter key to act as an activation key only when the 
  458.    cursor is in the last field of a window (as defined by the order of W_FIELD 
  459.    calls). When the cursor is in any other field, the Enter key causes it to 
  460.    jump to the next field. 
  461.  
  462. Keyboard_option can be: 
  463.  
  464. E  (Enhanced) allows the F11, F12, and dedicated keypad keys on the IBM 
  465.    Enhanced Keyboard to act as activation keys. In addition, the key codes of 
  466.    certain keys on the dedicated keypad of the Enhanced Keyboard (such as 
  467.    PageUp/PageDown) are distinct from codes of keys on the numeric keypad. 
  468.    (There is no effect on the behavior of keys that do not cause activation.) 
  469.  
  470. F  (Fold) is like E, except that key codes are "folded" so that, if you have an 
  471.    Enhanced Keyboard, analogous keys on the numeric and dedicated keypads have 
  472.    the same codes. This is the default option. 
  473.  
  474.  
  475. ΓòÉΓòÉΓòÉ 4.12. W_MOVE ΓòÉΓòÉΓòÉ
  476.  
  477. W_MOVE(window,row,col) 
  478.  
  479. Restores the contents of the screen under the window at its current location, 
  480. and redraws the window at a new location. Returns 1 if successful, 0 if window 
  481. would be positioned off screen. 
  482.  
  483. Window is the window handle as returned by W_OPEN. 
  484.  
  485. Row and col are the row and column numbers in the coordinate system of the 
  486. entire screen of the new upper left corner of the window. The window cannot be 
  487. moved to a new position if that would cause any part of the window to extend 
  488. beyond the screen boundaries. 
  489.  
  490.  
  491. ΓòÉΓòÉΓòÉ 4.13. W_OPEN ΓòÉΓòÉΓòÉ
  492.  
  493. W_OPEN(row,col,height,width,[attr]) 
  494.  
  495. Opens a new window, and returns the window handle. 
  496.  
  497. The window handle must be specified in all of the remaining functions to 
  498. identify the window in question. A maximum of 5000 windows can be open at one 
  499. time. If W_OPEN fails because the maximum number of windows is already open, or 
  500. there is insufficient memory, a null string will be returned. 
  501.  
  502. Row and col are the screen coordinates of the upper left corner of the window. 
  503. (The upper left corner of the screen is 1,1.) 
  504.  
  505. Height and width are the dimensions of the window in character rows and 
  506. columns. If part of the window would be off the screen, the height and width of 
  507. the window will be adjusted to fit. (Note that you can open a window larger 
  508. than 25 * 80, but only if your display is configured so that it uses more than 
  509. 25 lines and 80 columns.) 
  510.  
  511. All parts of the window for which a screen attribute is not explicitly provided 
  512. will use attr. The default for attr is 7. For information on how to specify 
  513. attr, refer to the description of the SCRWRITE() function. 
  514.  
  515.  
  516. ΓòÉΓòÉΓòÉ 4.14. W_PUT ΓòÉΓòÉΓòÉ
  517.  
  518. W_PUT(window,row,col,[string],[length],[attr],[pad]) 
  519.  
  520. Displays a character string in a window, with optional display attribute and 
  521. pad character. Always returns 1. 
  522.  
  523. Window is the window handle as returned by W_OPEN. 
  524.  
  525. Row and col are the row and column numbers within the window at which the 
  526. string is to be written. (The upper left corner of the window is 1,1.) 
  527.  
  528. String is the character string to be written. If not specified, the null string 
  529. is assumed. 
  530.  
  531. Length is the number of characters to be written. The default is the length of 
  532. string. The output is truncated at the right edge of the window and does not 
  533. wrap around. 
  534.  
  535. Attr is the display attribute to be used. The default is as defined by the 
  536. W_OPEN call. 
  537.  
  538. The default pad character is a blank. 
  539.  
  540. Note: W_PUT is included primarily for compatibility with an earlier version of 
  541. RXWINDOW. W_SCRWRITE, described later in this section, is the preferred method 
  542. for writing to a window.  There are two differences between W_PUT and 
  543. W_SCRWRITE: 
  544.  
  545.  
  546.                      W_PUT                     W_SCRWRITE
  547.  
  548.                      Output is truncated at    Output wraps if
  549.                      right edge of window.     necessary.
  550.  
  551.                      Like other windowing      Like REXXLIB SCRxxxx
  552.                      functions, attr precedes  functions, pad precedes
  553.                      pad.                      attr.
  554.  
  555.  
  556. ΓòÉΓòÉΓòÉ 4.15. W_READ ΓòÉΓòÉΓòÉ
  557.  
  558. W_READ(window,[field_name],[activate],[changes]) 
  559.  
  560. Reads user input from any currently defined input fields. At least one such 
  561. field must have been defined. 
  562.  
  563. Window is the window handle as returned by W_OPEN. 
  564.  
  565. If field_name is specified, it designates the field in which the cursor is 
  566. initially to be positioned. Alphabetic case is ignored (even if field_name is 
  567. specified as a literal string, as it normally would be). If a field_name isn't 
  568. specified, the cursor is initially positioned in the first field defined for 
  569. window. 
  570.  
  571. Activate determines which keys are used to indicate that data entry is 
  572. complete: 
  573.  
  574.  N  (Normal), the default, means that only the Enter and Esc keys finish the 
  575.     operation. 
  576.  
  577.     If Enter is pressed, the data currently in each field will be assigned to 
  578.     the corresponding REXX variable. If Esc is pressed, W_READ terminates but 
  579.     does not set any REXX variables. 
  580.  
  581.  F  (Function-keys) means that in addition to the Enter and Esc keys, function 
  582.     keys and other special keys (other than the editing keys described in 
  583.     connection with W_GET) also end the operation. Any data entered will always 
  584.     be returned. 
  585.  
  586.     In addition to the field variables, the following special variables are 
  587.     set: 
  588.  
  589.     _ACTIVATION_KEY               contains the code for the key that ended 
  590.                                   W_READ, if activate is F. 
  591.  
  592.     _ACTIVATION_KEYNAME           contains the name, in uppercase, of the key 
  593.                                   that ended W_READ, if activate is F. (See 
  594.                                   W_GET for a list of key names.) 
  595.  
  596.     _ACTIVATION_FIELD             contains the name, in uppercase, of the field 
  597.                                   that the cursor was in when the function was 
  598.                                   terminated, unless activate is N and the 
  599.                                   Escape key was used. 
  600.  
  601.  W_READ returns 0 if activate is N and the read is terminated by the Esc key. 
  602.  Otherwise, W_READ returns 1. 
  603.  
  604.  Changes, if specified, is the name of a REXX stem that will be set to the list 
  605.  of names of fields that have been changed. For instance, if changes is 'list', 
  606.  then LIST.0 will contain the number of changed fields, and LIST.1, etc., will 
  607.  contain the names of the changed fields. 
  608.  
  609.  Notes: 
  610.  
  611.  o While W_READ is active, the user has the same editing keys available as with 
  612.    W_GET. In addition, the Tab and Shift-Tab keys can be used to go to the next 
  613.    or previous fields. The up and down cursor keys have the same effect.  See 
  614.    W_KEYS for how you can control the behavior of the editing keys during a 
  615.    W_READ. 
  616.  
  617.  o At the time W_READ is called, each defined field is filled with the current 
  618.    value of the REXX variable having the same name. The pad character and 
  619.    attribute byte associated with the field are used in displaying this value. 
  620.    If the REXX variable is undefined, only pad characters will be displayed. 
  621.  
  622.    If field_name is the same as a REXX compound variable, the usual rules will 
  623.    be applied to determine the value. For instance, if field_name is specified 
  624.    as age.person and the REXX variable person has the value fred, then the 
  625.    value of age.fred is used. This will be the same result as if field_name had 
  626.    been specified as age.fred (provided fred itself is not a defined REXX 
  627.    variable). 
  628.  
  629.  o When W_READ terminates and the value of field_name is set, this value will 
  630.    usually be that of the variable associated with the field. However, because 
  631.    of the REXX compound variable rules, data can be assigned to different 
  632.    variables if this process happens to change any component, except the stem, 
  633.    of a compound name. For instance, if you have a field whose name was 
  634.    specified as person and the REXX variable person is assigned the new value 
  635.    mary, then the data for the age.person field will be assigned to the REXX 
  636.    variable age.mary. (Since the assignments are made in the order the fields 
  637.    are defined, this presumes that the person field is defined before the 
  638.    age.person field.) 
  639.  
  640.  
  641. ΓòÉΓòÉΓòÉ 4.16. W_SCRPUT ΓòÉΓòÉΓòÉ
  642.  
  643. W_SCRPUT(window,row,col,string,[option]) 
  644.  
  645. Displays a string of text, attributes, or both in a window. Always returns 1. 
  646.  
  647. Window is the window handle as returned by W_OPEN. 
  648.  
  649. Row and col are the row and column numbers within the window at which the 
  650. string is to be written.  The upper left-hand corner of the window is 1, 1. 
  651.  
  652. String is the string of text, attributes, or both which is to be written. If 
  653. the string is too long to fit on the line of the window where it starts, it 
  654. will wrap around to following lines, up to the end of the window. 
  655.  
  656. Option can be: 
  657.  
  658.  T  (Text), the default. The string contains only text characters. Attributes 
  659.     already present do not change. 
  660.  
  661.  A  (Attributes). The string contains only attribute characters. Text already 
  662.     present does not change. 
  663.  
  664.  B  (Both). The string consists of character-attribute pairs. The attribute 
  665.     character follows the text character in each pair. LENGTH(string)/2 screen 
  666.     positions are written. 
  667.  
  668.  W_SCRPUT is analogous to the SCRPUT() function. 
  669.  
  670.  
  671. ΓòÉΓòÉΓòÉ 4.17. W_SCRREAD ΓòÉΓòÉΓòÉ
  672.  
  673. W_SCRREAD(window,row,col,length,[option]) 
  674.  
  675. Reads and returns a string of text, attributes, or both from a window. 
  676.  
  677. Window is the window handle as returned by W_OPEN. 
  678.  
  679. Row and col are the row and column numbers within the window at which reading 
  680. begins.  The upper left-hand corner of the window is 1, 1. 
  681.  
  682. Length is the number of screen positions in the window to read. If the data to 
  683. be read extends beyond the end of the line, the function will wrap around to 
  684. following lines up to the end of the window. 
  685.  
  686. Option can be: 
  687.  
  688.  T  (Text), the default. Only text characters are read. 
  689.  
  690.  A  (Attributes). Only attribute characters are read. 
  691.  
  692.  B  (Both). Character-attribute pairs are read. The attribute character follows 
  693.     the text character in each pair. Length pairs are read, for a total result 
  694.     length of 2*length. 
  695.  
  696.  Only data which has been written to the window with RXWINDOW functions is read 
  697.  by W_SCRREAD. 
  698.  
  699.  W_SCRREAD is analogous to the SCRREAD() function. 
  700.  
  701.  
  702. ΓòÉΓòÉΓòÉ 4.18. W_SCRWRITE ΓòÉΓòÉΓòÉ
  703.  
  704. W_SCRWRITE(window,row,col,[string],[length],[pad],[attr]) 
  705.  
  706. Writes a text string to the screen at the specified row and column of a window. 
  707. Always returns 1. 
  708.  
  709. Window is the window handle as returned by W_OPEN. 
  710.  
  711. Row and col are the row and column numbers within the window at which the 
  712. string is to be written.  The upper left-hand corner of the window is 1, 1. 
  713. (Note that, unlike the SCRWRITE() function, row and col must be specified with 
  714. W_SCRWRITE.) 
  715.  
  716. String is truncated (or padded with pad) to the given length. Characters are 
  717. written to the screen using the attribute attr. Text is not truncated at the 
  718. right edge of the window, but instead wraps from line to line. 
  719.  
  720. The default for string is the null string. 
  721.  
  722. The default for length is the length of string. 
  723.  
  724. The default for pad is a blank. 
  725.  
  726. The default for attr is as defined by the W_OPEN call.  W_SCRWRITE is analogous 
  727. to the SCRWRITE() function. 
  728.  
  729.  
  730. ΓòÉΓòÉΓòÉ 4.19. W_SIZE ΓòÉΓòÉΓòÉ
  731.  
  732. W_SIZE(window) 
  733.  
  734. Returns the height and width of the specified window. 
  735.  
  736. Window is the window handle as returned by W_OPEN. 
  737.  
  738. W_SIZE is analogous the the SCRSIZE() function. 
  739.  
  740.  
  741. ΓòÉΓòÉΓòÉ 4.20. W_UNFIELD ΓòÉΓòÉΓòÉ
  742.  
  743. W_UNFIELD(window,field_name) 
  744.  
  745. Removes an input field from a window. Always returns 1. 
  746.  
  747. Window is the window handle as returned by W_OPEN. 
  748.  
  749. Field_name must have been defined previously with W_FIELD. The area of the 
  750. window occupied by the field will be cleared to blanks with the default window 
  751. attribute. It is not necessary to call W_UNFIELD before closing the window with 
  752. W_CLOSE. 
  753.  
  754.  
  755. ΓòÉΓòÉΓòÉ 4.21. W_UNHIDE ΓòÉΓòÉΓòÉ
  756.  
  757. W_UNHIDE(window) 
  758.  
  759. Reverses the effect of W_HIDE, making a window and all further updates to it 
  760. fully visible. Always returns 1. 
  761.  
  762. Window is the window handle as returned by W_OPEN. 
  763.  
  764.  
  765. ΓòÉΓòÉΓòÉ 5. Specifying Field Names ΓòÉΓòÉΓòÉ
  766.  
  767. Many people who are just starting to use RXWINDOW have problems with programs 
  768. that use W_FIELD and W_READ.  The problems usually stem from errors in 
  769. specifying field names passed to these functions. 
  770.  
  771. Field names should normally be specified as literal strings. For example, the 
  772. program below has a subtle bug: 
  773.  
  774.       name = 'John'
  775.       w = w_open(4,3,3,50)
  776.       call w_border w
  777.       call w_put w, 2, 3, 'Name:',,15
  778.       call w_field w, name, 2, 9, 30, 112
  779.       call w_read w
  780.       call w_close w
  781.       say 'Name entered =' name
  782.       say 'John =' john
  783.  
  784. Here, a window is opened that has a single field.  The programmer intended for 
  785. this field to be called <NAME>, for this field to be initialized to John, and 
  786. for any user input to override this initial value. 
  787.  
  788. What happens instead is that the field is named <JOHN> and no initial value is 
  789. set.  Any user input changes the value of a variable called <JOHN>; the value 
  790. of the variable <NAME> does not change.  So, the program always displays 
  791.  
  792.       Name entered = John
  793.  
  794. The problem is with the clause 
  795.  
  796.       call w_field w, name, 2, 9, 30, 112
  797.  
  798. REXX evaluates <name>, a variable that was previously assigned the value John. 
  799. The name of the field is therefore <JOHN>. 
  800.  
  801. What's really needed is: 
  802.  
  803.       call w_field w, "name", 2, 9, 30, 112
  804.  
  805. REXX evaluates the literal string "name".  The name of the field is therefore 
  806. <NAME>, as desired. 
  807.  
  808.  
  809. ΓòÉΓòÉΓòÉ 6. Usage Notes ΓòÉΓòÉΓòÉ
  810.  
  811.  o If you have defined overlapping windows, you should work only with the 
  812.    topmost window. For example you should not close or move a window if 
  813.    overlapping windows are defined on top of it. Otherwise, incorrect data may 
  814.    be displayed in the overlapping area. 
  815.  
  816.  o You cannot conveniently mix window-oriented screen interaction with normal 
  817.    screen I/O. The REXX SAY instruction, the SCRWRITE() function, and any 
  818.    program that writes to the screen with normal system facilities will 
  819.    probably either overwrite a window or cause unwanted scrolling. There is no 
  820.    way to redirect such output directly to a window. However, the output of 
  821.    many commands can be redirected to a file, and portions of this file could 
  822.    be displayed using the windowing function package. 
  823.  
  824.  o If you want to save the contents of the screen before displaying a window or 
  825.    running a program that needs to use the screen itself, a convenient method 
  826.    is to define a window that covers the whole screen (without borders). When 
  827.    this window is subsequently closed, the previous contents of the screen will 
  828.    be restored. Just remember that each such full-screen window requires 8000+ 
  829.    bytes of storage. 
  830.  
  831.  o Another method of saving and restoring screens is to use the SCRREAD() and 
  832.    SCRPUT() functions. This takes only 4000 bytes of storage per screen. 
  833.  
  834.  o REXX programs that use windowing functions can test whether the RXWINDOW 
  835.    package is loaded by using 
  836.  
  837.                 RXFUNCQUERY('W_OPEN')
  838.  
  839.