home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / apmtst.zip / apmtdoc.inf (.txt) < prev    next >
OS/2 Help File  |  1994-09-27  |  49KB  |  2,174 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Product Information ΓòÉΓòÉΓòÉ
  3.  
  4.     Author: Dev Banerjee
  5.  
  6.     (C) Copyright International Business Machines Corporation 1994.
  7.  
  8.     All rights reserved
  9.  
  10.  
  11. ΓòÉΓòÉΓòÉ 2. What is APMT? ΓòÉΓòÉΓòÉ
  12.  
  13. APMT is a program package that provides a set of REXX functions. These 
  14. functions can be used to write REXX programs which can drive any PM application 
  15. running in the same PC or in a different PC. Some of the functions query the 
  16. state of the  PM window controls, while others change them. This allows the 
  17. REXX program (hereinafter called APMT client) to act in place of a human 
  18. operator. 
  19.  
  20. An APMT client program does not require any special environment to run under. 
  21. It can be invoked from any OS/2 command line or equivalent. 
  22.  
  23.  
  24. ΓòÉΓòÉΓòÉ 2.1. Uses ΓòÉΓòÉΓòÉ
  25.  
  26. Following are some uses of APMT. 
  27.  
  28. o As scripts to run automated test programs for PM applications. 
  29.  
  30.   This is the main intended use of the tool. 
  31.  
  32.   APMT is intended for testing a product based on its specifications, in a way 
  33.   that automated testcases can be written without requiring a product driver to 
  34.   be available first. 
  35.  
  36.   APMT does not have screen save/compare, or testcase record/playback features. 
  37.  
  38. o As a driver for programs to be executed on remote machines. 
  39.  
  40.   Another possible use of APMT is to start a program in a remote machine. If 
  41.   that program is a PM application then it can be monitored and driven using 
  42.   APMT functions. 
  43.  
  44. o As an interface between a REXX program and standard OS/2 Workplace Shell 
  45.   controls. 
  46.  
  47.   APMT can be used to develop simple, but yet effective, programs to manipulate 
  48.   Workplace objects which can help automate routine tasks. 
  49.  
  50.  
  51. ΓòÉΓòÉΓòÉ 3. Installation and use ΓòÉΓòÉΓòÉ
  52.  
  53.  
  54. ΓòÉΓòÉΓòÉ 3.1. Prerequisites ΓòÉΓòÉΓòÉ
  55.  
  56. APMT runs on OS/2 2.x and requires REXX to be installed. 
  57.  
  58. If the target application is on a remote machine, both machines need to be 
  59. running OS/2 2.x and be LAN connected. 
  60.  
  61.  
  62. ΓòÉΓòÉΓòÉ 3.2. How to Install. ΓòÉΓòÉΓòÉ
  63.  
  64. Installation consists of the following. Note that the files need to be in the 
  65. directories indicated, regardless of whether they are in the current directory, 
  66. in order for APMT to run reliably. 
  67.  
  68.  move   APMTEXT.DLL   to a directory in the LIBPATH
  69.  move   APMTDLL.DLL   to a directory in the LIBPATH
  70.  move   APMOCRW.DLL   to a directory in the LIBPATH
  71.  move   APMNP.DLL     to a directory in the LIBPATH
  72.  move   APMNETB.DLL   to a directory in the LIBPATH * needed only for remote operation
  73.  move   APMT.EXE      to a directory in the PATH
  74.  move   APMNETBL.EXE  to a directory in the PATH    * needed only for remote operation
  75.  move   IBMDABB.CP    to a directory in the DPATH
  76.  
  77.      Note for users of Distributed Applications/2. 
  78.  
  79.      APMT is an application that uses Distributed Applications/2. 
  80.  
  81.      The file IBMDABB.CP contains the connection profiles. 
  82.  
  83.      If you are a user of other Distributed Applications/2 applications, you 
  84.      may want to combine the IBMDABB.CP files for the different applications. 
  85.  
  86.  
  87. ΓòÉΓòÉΓòÉ 4. Limitations ΓòÉΓòÉΓòÉ
  88.  
  89. APMT can only operate on controls using standard PM classes. Therefore if an 
  90. application uses non standard classes then APMT cannot be used for these 
  91. controls. A limited support for non standard controls is provided via the MOUSE 
  92. functions. 
  93.  
  94. The set of functions provided in the current package allow you to perform many 
  95. interesting tasks. However, it easy to imagine additional functions that could 
  96. be added to the package. Please provide suggestions/requirements to the author. 
  97.  
  98.  
  99. ΓòÉΓòÉΓòÉ 4.1. Considerations for timing related problems ΓòÉΓòÉΓòÉ
  100.  
  101. Since APMT client will tend to drive the application much faster than a human 
  102. operator, it will be necessary at times to pause so that the selected actions 
  103. are not executed too early. For example, after pressing a button to cancel a 
  104. modal dialog box, it may be necessary to wait before directing any input to the 
  105. parent window to allow time for the dialog box to be dismissed. 
  106.  
  107. Often, it is possible to set up a simple Rexx loop to wait for the desired 
  108. condition before proceeding further. 
  109.  
  110.  The WAIT and SET_TIMEOUT functions, and the retry parameters to the 
  111. SELECT_WINDOW, and SELECT_DIALOG_WINDOW are some of the means to achieve the 
  112. delay. 
  113.  
  114. Also, if the application displays the "wait" pointer, APMT automatically waits 
  115. for it to be cleared before servicing a function. 
  116.  
  117.  
  118. ΓòÉΓòÉΓòÉ 5. APMT client Program Structure ΓòÉΓòÉΓòÉ
  119.  
  120. The APMT client is simply a REXX program using APMT functions and any other 
  121. REXX functions and features. The following is a simple example of the structure 
  122. of an APMT client program. 
  123.  
  124.  o Startup instructions as follows: 
  125.  
  126.          /******************************************************************/
  127.          /* Part 1: common prefix                                          */
  128.          /******************************************************************/
  129.          Trace off
  130.          call APMT_INIT
  131.  
  132.  o Main APMT client instructions, for example: 
  133.  
  134.          /******************************************************************/
  135.          /* Part 2: Program specific instructions                          */
  136.          /******************************************************************/
  137.          rc = SELECT_WINDOW("Icon Editor","10")
  138.          ...
  139.  
  140.  o Terminating instructions, as follows: 
  141.  
  142.          /******************************************************************/
  143.          /* Part 3: common suffix                                          */
  144.          /******************************************************************/
  145.          APMT_CLOSE:
  146.          rc = END_SESSION();
  147.          exit
  148.  
  149.          DropFUNC:      /* function normally not needed */
  150.          call APMTDropFuncs;
  151.          call rxfuncdrop(APMTDropFuncs)
  152.          return
  153.  
  154.          APMT_INIT:
  155.          call rxfuncadd  'APMTLoadFuncs',  'apmtext', 'APMTLoadFuncs'  /* entry points from the DLL    */
  156.          call APMTLoadFuncs;
  157.          rc = INIT_SESSION();
  158.          if rc \= 0
  159.             then do
  160.               say apmtmsg
  161.               exit
  162.               end
  163.          signal on error name  APMT_CLOSE
  164.          if apmtver.client \= apmtver.server then
  165.             say 'WARNING: Version mismatch. Client ='apmtver.client 'Server ='apmtver.server
  166.             else say 'Running APMT version 'apmtver.client
  167.          signal on halt name APMT_CLOSE
  168.          return
  169.  
  170.  
  171.  
  172. ΓòÉΓòÉΓòÉ 5.1. General syntax rules ΓòÉΓòÉΓòÉ
  173.  
  174.  o All APMT client calls are of the same format: 
  175.  
  176.            rc = APMT_CALL(parm1, .. ,parmN)
  177.  
  178.  o If a parm is optional, it is indicated in the description of the function. 
  179.    If a required parm is missing REXX will return with 'INCORRECT CALL TO 
  180.    ROUTINE' message. 
  181.  
  182.  o Some functions return data to the APMT client. 
  183.  
  184.  o Three types of data are returned: 
  185.  
  186.     Rexx single variables 
  187.  
  188.     Rexx stem  variables 
  189.  
  190.     OS/2 files 
  191.  
  192.  The type of data to be returned is indicated in the function description. 
  193.  
  194.  
  195.  For these functions, the name of the variable, or file, is always the last 
  196.  parameter of the function. It is safer to provide this name in quotes. 
  197.  
  198.  The value of a stem variable is as updated as follows. If "xxx" is the 
  199.  variable name passed, then on return, xxx.0 contains the number of additional 
  200.  stems. xxx.1, .. xxx.(xxx.0) contain the rest of the stem values. Other stems 
  201.  of xxx are unchanged. 
  202.  
  203.  The value of the variable is set to the null string if the call was 
  204.  unsuccessful with a return code greater than 0. For stem variables, the .0 
  205.  stem is set to null and any other stems are unchanged. 
  206.  
  207.  o Many of the functions require the text of the window control as parameter to 
  208.    identify the window. Except for SELECT_WINDOW and SELECT_DIALOGWINDOW, the 
  209.    text should be exact. The match is case sensitive, and blanks are not 
  210.    ignored. 
  211.  
  212.  o Some functions require the sequence number of the window control as it 
  213.    appear in the selected window to identify it. 
  214.  
  215.  o Controls are assigned sequence numbers according to their appearance in the 
  216.    selected window, from top to bottom and left to right. 
  217.  
  218.  
  219. ΓòÉΓòÉΓòÉ 5.2. Return codes and error messages ΓòÉΓòÉΓòÉ
  220.  
  221. In the description of a APMT function, only the return codes which are unique 
  222. for that function are explained. The common return codes apply to all functions 
  223. and are not repeated. 
  224.  
  225. Return code 0 indicates success. However, for some functions, this simply means 
  226. that the appropriate message was sent to the application. The results of that 
  227. message is not indicated in this return code. 
  228.  
  229. Return code 4 indicates that APMT could not locate the specified control 
  230. window. 
  231.  
  232. Return codes between 5 and 7 indicate a call specific error condition and are 
  233. described in the function description. 
  234.  
  235. Return code 8 indicates an incorrect environment for the call. For example, a 
  236. PUSHBUTTON_CLICK call without a selected window will result in this code. This 
  237. code will also occur if the target application has been terminated or some 
  238. other condition has made the selected window invalid. 
  239.  
  240. Return code 12 indicates that the session is not open. 
  241.  
  242. Return codes 20 or greater indicate a possible bug in APMT. Please report these 
  243. to the author. 
  244.  
  245. Syntax and environment setup errors are intercepted by REXX and result in such 
  246. messages as 'ROUTINE NOT FOUND' and 'INCORRECT CALL TO ROUTINE' 
  247.  
  248. APMT sets a rexx variable, APMTMSG, after each function call. If the return 
  249. code from the function is 0, this variable is set to null. If the return code 
  250. is non-zero, this variable contains a message indicating the cause. 
  251.  
  252.  
  253. ΓòÉΓòÉΓòÉ 6. The APMT Functions ΓòÉΓòÉΓòÉ
  254.  
  255. This section describes all the APMT client functions. As the tool evolves, more 
  256. functions will be added or existing functions will be enhanced. 
  257.  
  258.  
  259. ΓòÉΓòÉΓòÉ 6.1. INIT_SESSION ΓòÉΓòÉΓòÉ
  260.  
  261. This function establishes a APMT session. 
  262. Syntax 
  263.  
  264.     rc = INIT_SESSION([app_location])
  265.        where app_location is RMTNETnn, and nn = {01, 02, .. 20}
  266.  
  267. Examples 
  268.  
  269.     rc = INIT_SESSION()
  270.  
  271.     rc = INIT_SESSION("RMTNET01")
  272.  
  273. Description 
  274.  
  275. This function must be the first APMT call before any significant function can 
  276. be called. 
  277.  
  278. The parameter is optional and identifies where the target application resides. 
  279. If it is missing, then it is assumed to be in the same PC. 
  280.  
  281. If it is on a different PC, then the following has to be done prior to this 
  282. call: 
  283.  
  284.  APMT installed on the remote machine. 
  285.  
  286.  The two machines must be on the same LAN. 
  287.  
  288.  Invoke "APMNETBL RMTNETnn" from any OS/2 command line on the remote machine. 
  289.  This function will start an OS/2 session which has no screen i/o. This session 
  290.  should be kept running as long as an APMT session to that machine is needed. 
  291.  
  292.  If you get an error when you run APMNETBL, you also get a NETBIOS return code 
  293.  which indicates the error. Common causes of failure are name RMTNETnn already 
  294.  in use, no NETBIOS sessions available, and network not accessed. 
  295.  
  296.  Note that APMNETBL essentially identifies the remote machine to the LAN, and 
  297.  therefore two distinct invocations cannot use the same nn value 
  298.  simultaneously. 
  299.  
  300.  The invocation parameter for INIT_SESSION should match the parameter to 
  301.  APMNETBL. 
  302.  
  303.      Note on remote connections. 
  304.  
  305.      It is possible to have the target application on an APPC-connected OS/2 
  306.      machine also. Contact the author if you have any needs/interest in this. 
  307.  Return Codes 
  308.  
  309.  o 0  - connection successful 
  310.  
  311.  o 8  - connection unsuccessful 
  312.  
  313.  o 12 - too many sessions 
  314.  
  315.  Notes 
  316.  
  317.  If the target is on a different machine, this function may take somewhat 
  318.  longer to complete, perhaps as much as 15 seconds. The result will be that the 
  319.  REXX program will appear slow to start. After the connection is complete, 
  320.  there should not be any additional delay, however, for subsequent actions. 
  321.  
  322.  The session is closed by the END_SESSION call. 
  323.  
  324.  When a session is opened, APMT updates two stem variables APMTVER.CLIENT, and 
  325.  APMTVER.SERVER. These are only needed to ensure that different part of APMT 
  326.  are at the same version level. The client here is the APMT client program, and 
  327.  the server is the part of APMT which drives the target application. It is 
  328.  important that the versions match. 
  329.  
  330.  APMT will support up to 20 sessions at the same time. After a session is 
  331.  opened, all APMT calls are directed to this session, until another session is 
  332.  opened with INIT_SESSION, or SELECT_SESSION is called to switch to another 
  333.  open session. 
  334.  
  335.  
  336. ΓòÉΓòÉΓòÉ 6.2. END_SESSION ΓòÉΓòÉΓòÉ
  337.  
  338. This function ends the currently selected APMT session. 
  339. Syntax 
  340.  
  341.     rc = END_SESSION()
  342.  
  343. Examples 
  344.  
  345.     rc = INIT_SESSION('RMTNET01')
  346.     rc = INIT_SESSION('RMTNET02')
  347.     rc = SELECT_SESSION('RMTNET01')
  348.     ...
  349.     rc = SELECT_SESSION('RMTNET02')
  350.     ...
  351.     rc = SELECT_SESSION('RMTNET01')
  352.     ...
  353.     rc = END_SESSION()          /* closes RMTNET01 */
  354.     rc = SELECT_SESSION('RMTNET02')
  355.     rc = END_SESSION()          /* closes RMTNET02 */
  356.  
  357. Description 
  358.  
  359. This function will close the currently selected session, and on return no 
  360. session remains selected, even if there are open sessions. To select a open 
  361. session at this time, use SELECT_SESSION. 
  362.  
  363. It is recommended that each open session be closed before exiting the APMT 
  364. client program. 
  365. Return Codes 
  366.  
  367.  o 0  - always. 
  368.  
  369.  
  370. ΓòÉΓòÉΓòÉ 6.3. SELECT_SESSION ΓòÉΓòÉΓòÉ
  371.  
  372. This function selects an open session for subsequent APMT functions. 
  373. Syntax 
  374.  
  375.     rc = SELECT_SESSION(app_location)
  376.        where app_location is RMTNETnn, and nn = {01, 02, .. 20}
  377.  
  378. Examples 
  379.  
  380.     rc = INIT_SESSION('RMTNET01')
  381.     rc = INIT_SESSION('RMTNET02')
  382.     rc = SELECT_SESSION('RMTNET01')
  383.     ...
  384.     rc = SELECT_SESSION('RMTNET02')
  385.     ...
  386.     rc = SELECT_SESSION('RMTNET01')
  387.     ...
  388.     rc = END_SESSION()          /* closes RMTNET01 */
  389.     rc = SELECT_SESSION('RMTNET02')
  390.     rc = END_SESSION()          /* closes RMTNET02 */
  391.  
  392. Description 
  393.  
  394. This function will select the session specified in the parameter, provided it 
  395. is open. 
  396. Return Codes 
  397.  
  398.  o 8  - specified session is not open 
  399.  
  400.  
  401. ΓòÉΓòÉΓòÉ 6.4. START_PROGRAM ΓòÉΓòÉΓòÉ
  402.  
  403. This function may be used to start an OS/2 program. 
  404. Syntax 
  405.  
  406.     rc = START_PROGRAM(pgm_name[,parm_string][,working_dir])
  407.  
  408. Examples 
  409.  
  410.     rc = START_PROGRAM("MYAPP.EXE")
  411.  
  412.     rc = START_PROGRAM("MYAPP.EXE","myparm1, myparm2")
  413.  
  414.     rc = START_PROGRAM("MYAPP.EXE","","Y:\TEST")
  415.  
  416. Description 
  417.  
  418. This function will start an OS/2 session with the specified program name and 
  419. pass the specified parameter string to the program. 
  420.  
  421. If the working_dir parameter is specified, the program will be started after 
  422. changing the current directory and disk to the specified working directory. It 
  423. may be necessary to do this for example if the program depends on DLLs to be 
  424. located in the current directory. 
  425. Return Codes 
  426.  
  427.  o 0  - The program was started 
  428.  
  429.  o 5  - Invalid working directory specified. 
  430.  
  431.  o 6  - The program startup failed. 
  432.  
  433.  Notes 
  434.  
  435.  For the purposes of APMT, the program is expected to be a PM application. 
  436.  However, this function can be used to start non-PM applications also. 
  437.  
  438.  Even though the application is started successfully, its application window 
  439.  may not be ready, and it may be necessary to wait for a subsequent 
  440.  SELECT_WINDOW to be successful. Either the WAIT function or the second 
  441.  parameter of SELECT_WINDOW may be used for this purpose. 
  442.  
  443.  
  444. ΓòÉΓòÉΓòÉ 6.5. SELECT_WINDOW ΓòÉΓòÉΓòÉ
  445.  
  446. This function selects a main application window as the target for subsequent 
  447. actions. 
  448. Syntax 
  449.  
  450.     rc = SELECT_WINDOW(window_title [,number_of_attempts] [,seq_number])
  451.  
  452. Examples 
  453.  
  454.     rc = SELECT_WINDOW("Icon Editor")
  455.     rc = SELECT_WINDOW("Icon Editor", "15")
  456.     rc = SELECT_WINDOW("I*Editor", "15")    /* using wild card character * */
  457.     /* List all the windows on the desktop */
  458.     n = 1
  459.     do while SELECT_WINDOW("*",1,n)  = 0
  460.        rc = QUERY_TITLE("title")
  461.        say 'WINDOW NO. 'n ': 'title
  462.        n = n+1
  463.        end
  464.  
  465. Description 
  466.  
  467. This function locates an application window with the given title and selects it 
  468. for subsequent actions. A window must be selected before any other functions 
  469. can be directed to it. Any previously selected window will be de-selected if 
  470. this call is successful. 
  471.  
  472. The specified title can contain wild card characters * and ?. 
  473.  
  474. The second parameter is an optional timeout value. If the window cannot be 
  475. located then the second parameter indicates how many attempts will be made. 
  476. APMT waits for 100 milliseconds (1/10 sec) before trying again. So, in the 
  477. second example above, at least 1.5 seconds will elapse before the function will 
  478. fail. This value defaults to, and must be at least, 1. If any other value is 
  479. specified, 1 is used. 
  480.  
  481. The third parameter is optional, and defaults to 1. If there are more than one 
  482. window which match the title specification in the first parameter, then 
  483. seq_number can be used to select the desired window. 1 means the topmost window 
  484. on the desktop. 
  485. Notes 
  486.  
  487.  If the specified window is not found, then the currently selected window will 
  488.  remain selected. 
  489.  
  490.  A window on the desktop whose title matches the given window_title, after 
  491.  taking any wild card characters into account, will be selected. To specify 
  492.  prefix only, the window_title must end in a *. 
  493.  
  494.  The match is case sensitive. 
  495.  
  496.  If there is more than one window which matches the title, then APMT will 
  497.  select the topmost window. There is no relationship between the selected 
  498.  window and the application started by START_PROGRAM. 
  499.  
  500.  Specifying "*" as the title will select the active window on the desktop. 
  501.  
  502.  Only one window can be selected at a time. 
  503.  
  504.  APMT will place the mouse pointer at the center of the selected window if this 
  505.  call is successful. 
  506.  
  507.  
  508. ΓòÉΓòÉΓòÉ 6.6. SELECT_WINDOW_BY_HANDLE ΓòÉΓòÉΓòÉ
  509.  
  510. This function selects a window whose handle is specified as the parameter. 
  511. Syntax 
  512.  
  513.     rc = SELECT_WINDOW_BY_HANDLE(window_handle)
  514.  
  515. Examples 
  516.  
  517.     /* Save window handle, and later select it by specifying handle */
  518.     rc = SELECT_WINDOW("CMD.EXE")
  519.     rc = QUERY_WINDOW_HANDLE("savehandle")
  520.     ...
  521.     rc = SELECT_WINDOW_BY_HANDLE(savehandle)
  522.  
  523. Description 
  524.  
  525. This function is similar to SELECT_WINDOW, but it uses the window handle as 
  526. parameter. To get the window handle, use the QUERY_WINDOW_HANDLE function. 
  527. Notes. 
  528.  
  529.  o This function, in conjunction with QUERY_WINDOW_HANDLE, can be used to save 
  530.    and restore window selections. This is helpful when the window title of the 
  531.    selected window changes, or there are multiple windows with the same title, 
  532.    and you need to select the particular window that you had selected before. 
  533.  
  534.  o APMT will not place the mouse pointer at the center of the selected window. 
  535.  
  536.  
  537. ΓòÉΓòÉΓòÉ 6.7. SELECT_DIALOGWINDOW ΓòÉΓòÉΓòÉ
  538.  
  539. This function selects a window on the desktop, which is a dialog box for the 
  540. currently selected window, for subsequent actions. 
  541. Syntax 
  542.  
  543.     rc = SELECT_DIALOGWINDOW(window_title [,number_of_attempts])
  544.  
  545. Examples 
  546.  
  547.     rc = SELECT_DIALOGWINDOW("Device List")
  548.  
  549.     rc = SELECT_DIALOGWINDOW("Device List", "15")
  550.  
  551.     rc = SELECT_DIALOGWINDOW(" ")
  552.  
  553. Description 
  554.  
  555. This function is similar to SELECT_WINDOW, and it selects a window which 
  556. belongs to the same process to which the currently selected window belongs. 
  557. Notes. 
  558.  
  559.  o This call deselects the previously selected window if the dialog window is 
  560.    successful, otherwise the previously selected window remains selected. 
  561.  
  562.  o The matching he desktop whose title matches the given window_title, after 
  563.    taking any wild card characters into account, will be selected. To specify a 
  564.    prefix only, the window_title must end in a *. 
  565.  
  566.    The title may be "*". In this case the topmost window on the desktop is 
  567.    selected (running in the application's process), regardless of its title. 
  568.    This function is useful if the target application displays message boxes 
  569.    which have blank titles or the title is unknown. 
  570.  
  571.    To return to the previous window, use SELECT_WINDOW again. 
  572.  
  573.    The second parameter is optional and has the same meaning as for 
  574.    SELECT_WINDOW. 
  575.  
  576.  o APMT will place the mouse pointer at the center of the selected window if 
  577.    this call is successful. 
  578.  
  579.  
  580. ΓòÉΓòÉΓòÉ 6.8. SELECT_SUBWINDOW ΓòÉΓòÉΓòÉ
  581.  
  582. This function selects a frame window which is a child of the currently selected 
  583. window, and returns its title. 
  584. Syntax 
  585.  
  586.     rc = SELECT_SUBWINDOW([seq_number,] variable_name)
  587.  
  588. Examples 
  589.  
  590.     rc = SELECT_WINDOW(Name)
  591.     do i = 1 to 5
  592.        rc = SELECT_SUBWINDOW(i,"title")
  593.        if rc = 0 then say  "subwindow "i " :" title
  594.        rc = SELECT_WINDOW(Name)
  595.        end
  596.  
  597. Description 
  598.  
  599. This function is provided to list the titles of sub windows in an IPF help 
  600. window, but other uses are possible. 
  601.  
  602. This changed the current window selection. 
  603.  
  604. The first parameter is optional and indicates the sequence number of the 
  605. subwindow to be selected. Default is 1. 
  606.  
  607. APMT will NOT place the mouse pointer at the center of the sub window. 
  608.  
  609.  
  610. ΓòÉΓòÉΓòÉ 6.9. SET_FOCUS ΓòÉΓòÉΓòÉ
  611.  
  612. This function makes the selected window the active window. 
  613. Syntax 
  614.  
  615.     rc = SET_FOCUS()
  616.  
  617. Examples 
  618.  
  619.     rc = SET_FOCUS()
  620.  
  621. Description 
  622.  
  623. This function will make the selected window active. 
  624. Return Codes 
  625.  
  626.  o 5  - Current window could not be made active. 
  627.  
  628.  Notes 
  629.  
  630.  There is no need to use this function for subsequent APMT functions. Use this 
  631.  only if you have a special need. 
  632.  
  633.  
  634. ΓòÉΓòÉΓòÉ 6.10. SET_TIMEOUT ΓòÉΓòÉΓòÉ
  635.  
  636. This function sets the default time out for selected APMT functions. 
  637. Syntax 
  638.  
  639.     rc = SET_TIMEOUT(number_of_attempts)
  640.  
  641.  
  642. Examples 
  643.  
  644.     rc = SET_TIMEOUT(200)
  645.  
  646. Description 
  647.  
  648. The parameter is a timeout value. If certain APMT functions, identified below, 
  649. will not work until the application is ready, then APMT will make 
  650. number_of_attempts before giving up. APMT waits for 100 milliseconds (1/10 sec) 
  651. before trying again. 
  652.  
  653. This value defaults to, and must be at least, 1. If any other value is 
  654. specified, 1 is used. 
  655.  
  656. This is a persistent setting, until changed by another SET_TIMEOUT call. 
  657.  
  658. This function is intended to help the APMT client program synchronize with the 
  659. target PM application. For example, if MENU_SELECT is invoked, and the timeout 
  660. is set to 200 then APMT will make up to 200 attempts, if it finds the menu item 
  661. disabled, before giving up. This gives approximately 20 seconds to the 
  662. application to enable the menu item. 
  663.  
  664. The following functions and events are affected by the timeout value. 
  665.  
  666.  o POPUPMENU_QUERY_ALL - Wait for popup menu to appear 
  667.  
  668.  o POPUPMENU_SELECT - Wait for popup menu to appear 
  669.  
  670.  o POPUPMENU_QUERY_STATE - Wait for popup menu to appear 
  671.  
  672.  o SYSMENU_SELECT - Wait for menu item to be enabled 
  673.  
  674.  o MENU_SELECT - Wait for menu item to be enabled 
  675.  
  676.  Notes 
  677.  
  678.  As needs are identified, more functions and events will be added to this list. 
  679.  
  680.  Return Codes 
  681.  
  682.  o 0 - Always. 
  683.  
  684.  
  685. ΓòÉΓòÉΓòÉ 6.11. QUERY_WINDOW_HANDLE ΓòÉΓòÉΓòÉ
  686.  
  687. Query the window handle of the selected window. 
  688. Syntax 
  689.  
  690.     rc = QUERY_WINDOW_HANDLE(variable_name)
  691.  
  692.  
  693. Examples 
  694.  
  695.        /* Get the handle  of the selected window */
  696.        rc = QUERY_TITLE("handle")
  697.        say "handle is " handle
  698.  
  699. Description 
  700.  
  701. This call returns a variable which contains the handle of the currently 
  702. selected window. 
  703.  
  704. This handle is intended to be used with a subsequent SELECT_WINDOW_BY_HANDLE 
  705. function call. 
  706.  
  707.  
  708. ΓòÉΓòÉΓòÉ 6.12. QUERY_PREV_RESPONSETIME ΓòÉΓòÉΓòÉ
  709.  
  710. Query the response time for the previous action, in milliseconds. 
  711. Syntax 
  712.  
  713.     rc = QUERY_PREV_RESPONSETIME(variable_name)
  714.  
  715.  
  716. Examples 
  717.  
  718.        /* Press the PUSHBUTTON "HELP"       */
  719.        rc = PUSHBUTTON_CLICK("HELP")
  720.        /* Wait for a the help window to appear */
  721.        rc = SELECT_WINDOW("Help for*",100)
  722.        /* Display the response time  */
  723.        if rc = 0 then do
  724.           rc = QUERY_PREV_RESPONSETIME("resp")
  725.           say 'The help window took 'resp 'milliseconds to appear'
  726.           end
  727.  
  728. Description 
  729.  
  730. For certain functions, APMT automatically notes the time the command was 
  731. executed. These commands are: PUSHBUTTON_CLICK, START_PROGRAM, MENU_SELECT, and 
  732. KEYBOARD with "ENTER" and "ESC" virtual keys. 
  733.  
  734. If these functions are immediately followed by SELECT_WINDOW, then APMT 
  735. calculates the time elapsed between the previous action and the window's 
  736. appearance on the desktop. 
  737.  
  738. If the next function is QUERY_PREV_RESPONSETIME, then this time elapsed is 
  739. returned in the Rexx variable. 
  740.  
  741. If the conditions are not met, this function will return with rc=5. 
  742. Return Codes 
  743.  
  744.  o 5 - No response time to report. 
  745.  
  746.  
  747. ΓòÉΓòÉΓòÉ 6.13. QUERY_TITLE ΓòÉΓòÉΓòÉ
  748.  
  749. Query the title of the selected window 
  750. Syntax 
  751.  
  752.     rc = QUERY_TITLE(variable_name)
  753.  
  754.  
  755. Examples 
  756.  
  757.        /* Get the full title of the selected window       */
  758.        rc = QUERY_TITLE("title")
  759.        say "title is " title
  760.  
  761. Description 
  762.  
  763. This call returns a variable which contains the full title of the currently 
  764. selected window. This may be different from the title text passed to the 
  765. previous SELECT_WINDOW or SELECT_DIALOGWINDOW, since in those functions 
  766.  
  767.  
  768. ΓòÉΓòÉΓòÉ 6.14. SAVE_IMAGE ΓòÉΓòÉΓòÉ
  769.  
  770. Save the currently selected window's image in a bitmap file 
  771. Syntax 
  772.  
  773.     rc = SAVE_IMAGE(file_name)
  774.  
  775.  
  776. Examples 
  777.  
  778.        /* Get the BITMAP image of the selected window       */
  779.        rc = SAVE_IMAGE("current.bmp")
  780.  
  781.  
  782. Description 
  783.  
  784. This call saves the bitmap image of the currently selected window, as a bitmap 
  785. file in the  machine. 
  786.  
  787. The parameter must be a valid file name. 
  788. Notes 
  789.  
  790.  The bitmap is in os/2 1.2 format currently. This may change in the future. 
  791.  
  792.  To view the bitmap, another suitable tool is needed (not provided with APMT). 
  793.  
  794.  Return Codes 
  795.  
  796.  o 5 - The bitmap could not be created. 
  797.  
  798.  o 6 - The specified file could not be opened 
  799.  
  800.  o 7 - The specified file could not be written to 
  801.  
  802.  
  803. ΓòÉΓòÉΓòÉ 6.15. WAIT ΓòÉΓòÉΓòÉ
  804.  
  805. This function causes a delay for the specified duration. 
  806. Syntax 
  807.  
  808.     rc = WAIT(number_of_milliseconds)
  809.  
  810. Examples 
  811.  
  812.     rc = WAIT("15000")
  813.  
  814.  
  815. Description 
  816.  
  817. This function effectively pauses the REXX program. 
  818.  
  819. The number_of_milliseconds is at least 1. 
  820. Return Codes 
  821.  
  822.  o 0  - always 
  823.  
  824.  Notes 
  825.  
  826.  The timing is approximate, the real wait time will be slightly higher. 
  827.  
  828.  This function simply issues a DosSleep call on behalf of the REXX program. 
  829.  
  830.  
  831. ΓòÉΓòÉΓòÉ 6.16. CHECKBOX_CLICK ΓòÉΓòÉΓòÉ
  832.  
  833. This function causes the specified CHECKBOX to be clicked. 
  834. Syntax 
  835.  
  836.     rc = CHECKBOX_CLICK(id[,seq_number])
  837.          where id is the text of the checkbox,
  838.          and seq_number is the sequence number of the checkbox with the same id.
  839.  
  840. Examples 
  841.  
  842.           /* Click the second checkbox labelled 'D' */
  843.           rc = CHECKBOX_CLICK("D",2)
  844.  
  845.           /* Click the first checkbox labelled 'red' */
  846.           rc = CHECKBOX_CLICK("red")
  847.  
  848.  
  849. Description 
  850.  
  851. As a result of this call the specified checkbox may go from checked to 
  852. unchecked state or vice versa depending on its previous state. In conjunction 
  853. with the CHECKBOX_QUERY_STATE function, this function can be used to set the 
  854. desired state. 
  855.  
  856. The second parameter is optional and defaults to 1. It is needed only if the 
  857. window has more than one checkbox with the same id. 
  858.  
  859.  
  860. ΓòÉΓòÉΓòÉ 6.17. CHECKBOX_QUERY_ALL ΓòÉΓòÉΓòÉ
  861.  
  862. Return the information on all checkboxes. 
  863. Syntax 
  864.  
  865.     rc =  CHECKBOX_QUERY_ALL(stem_variable_name)
  866.  
  867.  
  868. Examples 
  869.  
  870.        /* How many checkboxes?                          */
  871.        rc = CHECKBOX_QUERY_ALL( "cbox")
  872.        say "number of checkboxes: " cbox.0
  873.        do i = 1 to cbox.0
  874.           say 'checkbox  no 'i 'is: 'cbox.i
  875.           end
  876.  
  877. Description 
  878.  
  879. This function returns a stem variable which contains the information on all the 
  880. checkboxes in the selected window. 
  881.  
  882.  
  883. ΓòÉΓòÉΓòÉ 6.18. CHECKBOX_QUERY_STATE ΓòÉΓòÉΓòÉ
  884.  
  885. This function returns the checked, and enabled status of the specified 
  886. checkbox. 
  887. Syntax 
  888.  
  889.     rc = CHECKBOX_QUERY_STATE(id, stem_variable_name)
  890.          where id is the text identifying the checkbox.
  891.  
  892.  
  893. Examples 
  894.  
  895.        /* Make sure that the drive D is selected, and C is not selected */
  896.        rc = CHECKBOX_QUERY_STATE("D","state")
  897.        if rc = 0 then do
  898.           say 'Check   status: 'state.1
  899.           say 'Enable  status: 'state.2
  900.           end
  901.        if (state.1 = "UNCHECKED") then
  902.           rc = CHECKBOX_CLICK("D")
  903.        rc = CHECKBOX_QUERY_STATE("C","state")
  904.        if (state.1 = "CHECKED") then
  905.           rc = CHECKBOX_CLICK("C")
  906.  
  907. Description 
  908.  
  909. This function returns updates the stem variable specified in the last parameter 
  910. as follows. The .1 stem indicates the checked status and is either "CHECKED" or 
  911. "UNCHECKED". The .2 stem indicates the enabled status and is either "ENABLED" 
  912. or "DISABLED". 
  913.  
  914.  
  915. ΓòÉΓòÉΓòÉ 6.19. COMBOBOX_QUERY_ALL_TEXT ΓòÉΓòÉΓòÉ
  916.  
  917. Query the text of each item in a combobox. 
  918. Syntax 
  919.  
  920.     rc = COMBOBOX_QUERY_ALL_TEXT(seq_number, stem_variable_name)
  921.          where seq_number is the sequence number identifying the combobox.
  922.  
  923.  
  924. Examples 
  925.  
  926.        /* Look at the items of the second combobox        */
  927.        rc = COMBOBOX_QUERY_ALL_TEXT("2", "txt")
  928.        say txt.0 "items found"
  929.        do i = 1 to txt.0
  930.           say txt.i
  931.           end
  932.  
  933. Description 
  934.  
  935. This call returns a stem variable. The .0 stem contains the number of items in 
  936. the combobox. The .i stem contains the text of the i-th item. 
  937.  
  938.  
  939. ΓòÉΓòÉΓòÉ 6.20. COMBOBOX_QUERY_TEXT ΓòÉΓòÉΓòÉ
  940.  
  941. Query the text of the entryfield in a combobox. 
  942. Syntax 
  943.  
  944.     rc = COMBOBOX_QUERY_TEXT(seq_number, variable_name)
  945.          where seq_number is the sequence number identifying the combobox.
  946.  
  947.  
  948. Examples 
  949.  
  950.        /* Look at the entryfield of the second combobox        */
  951.        rc = COMBOBOX_QUERY_TEXT("2", "txt")
  952.        say txt
  953.  
  954. Description 
  955.  
  956. This call returns a variable whose value is the entryfield of the combobox. 
  957.  
  958.  
  959. ΓòÉΓòÉΓòÉ 6.21. COMBOBOX_SELECTITEM ΓòÉΓòÉΓòÉ
  960.  
  961. Select the specified item in a combobox. 
  962. Syntax 
  963.  
  964.     rc = COMBOBOX_QUERY_ALL_TEXT(seq_number, item_number)
  965.          where seq_number is the sequence number identifying the combobox,
  966.          and item_number identifies the item.
  967.  
  968.  
  969. Examples 
  970.  
  971.        /* Select the third item of the second combobox        */
  972.        rc =  COMBOBOX_SELECTITEM("2", "3")
  973.  
  974. Description 
  975.  
  976. This call selects the specified item of the combobox. 
  977. Return Codes 
  978.  
  979.  o 6 - Selection failed. Probably item number is out of range. 
  980.  
  981.  
  982. ΓòÉΓòÉΓòÉ 6.22. COMBOBOX_SET_TEXT ΓòÉΓòÉΓòÉ
  983.  
  984. Set the text of the entryfield in a combobox. 
  985. Syntax 
  986.  
  987.     rc = COMBOBOX_SET_TEXT( seq_number, text)
  988.          where seq_number is the sequence number identifying the combobox,
  989.          and text is what it should be set to.
  990.  
  991.  
  992. Examples 
  993.  
  994.        /* Set the value of the second combobox      */
  995.        rc = COMBOBOX_SET_TEXT("2", "D:")
  996.  
  997. Description 
  998.  
  999. This function sets the combobox text as specified if the text matches one of 
  1000. the items. If the specified text matches one of the items in the combobox, that 
  1001. item is selected. 
  1002.  
  1003. The specified text has to match only the prefix of an item. 
  1004. Notes 
  1005.  
  1006.  This is a 'convenience' function. 
  1007.  
  1008.  A better way is to enter the data is to use ENTRYFIELD_SET_FOCUS, followed by 
  1009.  KEYBOARD. 
  1010.  
  1011.  Return Codes 
  1012.  
  1013.  o 5 - The text does not match one of the items. 
  1014.  
  1015.  
  1016. ΓòÉΓòÉΓòÉ 6.23. CONTAINER_DESELECTITEM ΓòÉΓòÉΓòÉ
  1017.  
  1018. Deselect an item in the specified container. 
  1019. Syntax 
  1020.  
  1021.     rc = CONTAINER_DESELECTITEM(seq_number, object_identifier)
  1022.          where seq_number is the sequence number identifying the container,
  1023.          and object_identifier is
  1024.              either the text string identifying the object
  1025.              or #n with n = the object number
  1026.  
  1027.  
  1028. Examples 
  1029.  
  1030.        rc = CONTAINER_DESELECTITEM(1, "Main")
  1031.        rc = CONTAINER_DESELECTITEM(1, "#5")
  1032.  
  1033.  
  1034. Description 
  1035.  
  1036. This function deselects an object whose text has a prefix matching object_text. 
  1037. The match is case sensitive. 
  1038.  
  1039. The object may also be identified with "#" followed by its sequence number in 
  1040. the container. 
  1041. Return Codes 
  1042.  
  1043.  o 5 - No matching object found. 
  1044.  
  1045.  
  1046. ΓòÉΓòÉΓòÉ 6.24. CONTAINER_QUERY_COUNT ΓòÉΓòÉΓòÉ
  1047.  
  1048. Return the number of objects in the specified container. 
  1049. Syntax 
  1050.  
  1051.     rc = CONTAINER_QUERY_COUNT(seq_number, variable_name)
  1052.          where seq_number is the sequence number identifying the CONTAINER.
  1053.  
  1054.  
  1055. Examples 
  1056.  
  1057.        /* How many objects?                              */
  1058.        rc = CONTAINER_QUERY_COUNT("1", "count")
  1059.        say "number of objects in the container: " count
  1060.  
  1061. Description 
  1062.  
  1063. This function returns a variable which contains the number of objects in the 
  1064. container identified by the sequence number in the selected window. 
  1065.  
  1066.  
  1067. ΓòÉΓòÉΓòÉ 6.25. CONTAINER_SELECTITEM ΓòÉΓòÉΓòÉ
  1068.  
  1069. Select (high light) an item in the specified container. 
  1070. Syntax 
  1071.  
  1072.     rc = CONTAINER_SELECTITEM(seq_number, object_identifier)
  1073.          where seq_number is the sequence number identifying the container,
  1074.          and object_identifier is
  1075.              either the text string identifying the object
  1076.              or #n with n = the object number
  1077.  
  1078.  
  1079. Examples 
  1080.  
  1081.        /* Open the object labeled "Main"          */
  1082.        rc = CONTAINER_SELECTITEM(1, "Main")
  1083.        rc = KEYBOARD("ENTER")
  1084.        /* Select the 5th item on the desktop           */
  1085.        rc = SELECT_WINDOW("Desktop")
  1086.        rc = CONTAINER_SELECTITEM(1, "#5")
  1087.  
  1088.  
  1089. Description 
  1090.  
  1091. This function only highlights an object whose text has a prefix matching 
  1092. object_text. The match is case sensitive. 
  1093.  
  1094. The object may also be identified with "#" followed by its sequence number in 
  1095. the container. 
  1096. Return Codes 
  1097.  
  1098.  o 5 - No matching object found. 
  1099.  
  1100.  Notes 
  1101.  
  1102.  The first parameter is expected to be 1 as most windows have only one 
  1103.  container. 
  1104.  
  1105.  Other objects which were previously selected, remain selected. By using 
  1106.  KEYBOARD("\","C"), all the objects may be de-selected. 
  1107.  
  1108.  
  1109. ΓòÉΓòÉΓòÉ 6.26. ENTRYFIELD_HOW_MANY ΓòÉΓòÉΓòÉ
  1110.  
  1111. Return the number of entryfields. 
  1112. Syntax 
  1113.  
  1114.     rc = ENTRYFIELD_HOW_MANY( variable_name)
  1115.  
  1116.  
  1117. Examples 
  1118.  
  1119.        /* How many entryfields?                          */
  1120.        rc = ENTRYFIELD_HOW_MANY( "count")
  1121.        say "number of entryfields: " count
  1122.  
  1123. Description 
  1124.  
  1125. This function returns a variable which contains the number of entryfields in 
  1126. the selected window. 
  1127.  
  1128.  
  1129. ΓòÉΓòÉΓòÉ 6.27. ENTRYFIELD_QUERY_TEXT ΓòÉΓòÉΓòÉ
  1130.  
  1131. Query the text of an entry field. 
  1132. Syntax 
  1133.  
  1134.     rc = ENTRYFIELD_QUERY_TEXT( seq_number, variable_name)
  1135.          where seq_number is the sequence number identifying the entryfield.
  1136.  
  1137.  
  1138. Examples 
  1139.  
  1140.        /* Look at the items of the first entryfield      */
  1141.        rc = ENTRYFIELD_QUERY_TEXT("1", "txt")
  1142.        say txt
  1143.  
  1144. Description 
  1145.  
  1146. This function returns a variable which contains the text of the specified 
  1147. entryfield. 
  1148.  
  1149.  
  1150. ΓòÉΓòÉΓòÉ 6.28. ENTRYFIELD_SET_FOCUS ΓòÉΓòÉΓòÉ
  1151.  
  1152. This function sets the cursor on the specified entry field. 
  1153. Syntax 
  1154.  
  1155.     rc = ENTRYFIELD_SET_FOCUS(seq_number)
  1156.  
  1157. Examples 
  1158.  
  1159.        /* Enter the string text into the second entryfield     */
  1160.        rc = ENTRYFIELD_SET_FOCUS(2)
  1161.        rc = KEYBOARD("HOME");
  1162.        rc = KEYBOARD("DELETE","C");
  1163.        text    = 'PASSWORD'
  1164.        rc = KEYBOARD(text)
  1165.  
  1166. Description 
  1167.  
  1168. This function is used to set the input focus into a entry field. 
  1169. Notes 
  1170.  
  1171.  For the purposes of  this function, the entryfield part of a combobox is 
  1172.  treated like any other entryfield. For example if the window has entryfield 1, 
  1173.  combobox, entryfield 2, this function will treat the combobox as entryfield 2, 
  1174.  and entryfield 2 as entryfield 3. 
  1175.  
  1176.  
  1177. ΓòÉΓòÉΓòÉ 6.29. ENTRYFIELD_SET_TEXT ΓòÉΓòÉΓòÉ
  1178.  
  1179. Set the text of an entry field. 
  1180. Syntax 
  1181.  
  1182.     rc = ENTRYFIELD_SET_TEXT( seq_number, text)
  1183.          where seq_number is the sequence number identifying the entryfield,
  1184.          and text is what it should be set to.
  1185.  
  1186.  
  1187. Examples 
  1188.  
  1189.        /* Set the value of the first entryfield      */
  1190.        rc = ENTRYFIELD_SET_TEXT("1", "MYAPP.EXE")
  1191.  
  1192. Description 
  1193.  
  1194. This function sets the entryfield as specified. APMT will not update the field 
  1195. if it is not input enabled. 
  1196. Notes 
  1197.  
  1198.  This is a 'convenience' function. It may be misused by entering data in a way 
  1199.  not available to the user. For example, if this is used to set the text in a 
  1200.  non-display field (as for passwords), the password will be visible. 
  1201.  
  1202.  A better way is to use ENTRYFIELD_SET_FOCUS, followed by KEYBOARD calls. 
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  Return Codes 
  1208.  
  1209.  o 6 - The field is not enabled. 
  1210.  
  1211.  
  1212. ΓòÉΓòÉΓòÉ 6.30. KEYBOARD ΓòÉΓòÉΓòÉ
  1213.  
  1214. Simulate a keyboard event. 
  1215. Syntax 
  1216.  
  1217.     rc = KEYBOARD( key  [,shift_state])
  1218.  
  1219.  
  1220. Examples 
  1221.  
  1222.         rc = KEYBOARD("O","A")          /* simulate ALT+O       */
  1223.         rc = KEYBOARD("P","SA")         /* simulate ALT+SHIFT+P */
  1224.         rc = KEYBOARD("4","C")          /* simulate CTRL+4      */
  1225.         rc = KEYBOARD("F4","A")         /* simulate ALT+F4      */
  1226.         rc = KEYBOARD("ENTER")          /* simulate ENTER       */
  1227.         rc = KEYBOARD("ENTE")           /* simulate E,N,T,E     */
  1228.         rc = KEYBOARD("F12")            /* simulate F12         */
  1229.         rc = KEYBOARD("F123")           /* simulate F,1,2,3     */
  1230.  
  1231. Description 
  1232.  
  1233. The first parameter identifies either a virtual key or a character key. If the 
  1234. first parameter is not a recognized virtual key, all its characters will be 
  1235. played successively. However, strings that are longer than 30 may be truncated 
  1236. when played by APMT 
  1237.  
  1238. The second  parameter is optional and is a string consisting of one or more of 
  1239. the characters 'A', 'C', or 'S' to indicate ALT, CTRL, and SHIFT states 
  1240. respectively. The order of these characters is irrelevant, and duplicates and 
  1241. other characters are ignored. 
  1242.  
  1243.  The following virtual keys are recognized. These are case sensitive. 
  1244.  
  1245.  o BACKSPACE 
  1246.  
  1247.  o BACKTAB 
  1248.  
  1249.  o DELETE 
  1250.  
  1251.  o DOWN 
  1252.  
  1253.  o END 
  1254.  
  1255.  o ENTER 
  1256.  
  1257.  o ESC 
  1258.  
  1259.  o F1 
  1260.  
  1261.  o F2 
  1262.  
  1263.  o F3 
  1264.  
  1265.  o F4 
  1266.  
  1267.  o F5 
  1268.  
  1269.  o F6 
  1270.  
  1271.  o F7 
  1272.  
  1273.  o F8 
  1274.  
  1275.  o F9 
  1276.  
  1277.  o F10 
  1278.  
  1279.  o F11 
  1280.  
  1281.  o F12 
  1282.  
  1283.  o HOME 
  1284.  
  1285.  o INSERT 
  1286.  
  1287.  o LEFT 
  1288.  
  1289.  o NEWLINE 
  1290.  
  1291.  o PAGEDOWN 
  1292.  
  1293.  o PAGEUP 
  1294.  
  1295.  o RIGHT 
  1296.  
  1297.  o SPACE 
  1298.  
  1299.  o TAB 
  1300.  
  1301.  o UP 
  1302.  
  1303.  Return Codes 
  1304.  
  1305.  o 5  - Current window could not be made active. 
  1306.  
  1307.  Notes 
  1308.  
  1309.  This function determines the keystroke message to be played to the 
  1310.  application. It is not guaranteed that this will have the same effect as a 
  1311.  user's keyboard input, depending on how the application processes keyboard 
  1312.  messages. However, for "normal" applications, this will have the desired 
  1313.  effect. 
  1314.  
  1315.  Before the keystroke is played, the selected window will be brought to focus 
  1316.  if the focus belongs to another window on the desktop. 
  1317.  
  1318.  This function will normally always return code 0. This however does not 
  1319.  necessarily mean that the keystroke had the desired effect. 
  1320.  
  1321.  
  1322. ΓòÉΓòÉΓòÉ 6.31. LISTBOX_DESELECTITEM ΓòÉΓòÉΓòÉ
  1323.  
  1324. Deselect the specified item in a multiple selection listbox. 
  1325. Syntax 
  1326.  
  1327.     rc = LISTBOX_DESELECTITEM(seq_number, item_number)
  1328.          where seq_number is the sequence number identifying the listbox,
  1329.          and item_number identifies the item.
  1330.  
  1331.  
  1332. Examples 
  1333.  
  1334.        /* Deselect the third item of the second multiple selection listbox */
  1335.        rc =  LISTBOX_DESELECTITEM("2", "3")
  1336.  
  1337. Description 
  1338.  
  1339. This call deselects the specified item of the listbox. 
  1340. Notes 
  1341.  
  1342.  This function works only on multiple selection listboxes. 
  1343.  
  1344.  Return Codes 
  1345.  
  1346.  o 5 - The listbox is not multiple selection 
  1347.  
  1348.  o 6 - Deselection  failed. Probably item number is out of range 
  1349.  
  1350.  
  1351. ΓòÉΓòÉΓòÉ 6.32. LISTBOX_SELECTITEM ΓòÉΓòÉΓòÉ
  1352.  
  1353. Select the specified item in a listbox. 
  1354. Syntax 
  1355.  
  1356.     rc = LISTBOX_SELECTITEM(seq_number, item_number)
  1357.          where seq_number is the sequence number identifying the listbox,
  1358.          and item_number identifies the item.
  1359.  
  1360.  
  1361. Examples 
  1362.  
  1363.        /* Select the third item of the second listbox */
  1364.        rc =  LISTBOX_DESELECTITEM("2", "3")
  1365.  
  1366. Description 
  1367.  
  1368. This call selects the specified item of the listbox. 
  1369. Return Codes 
  1370.  
  1371.  o 6 - Selection failed. Probably item number is out of range 
  1372.  
  1373.  
  1374. ΓòÉΓòÉΓòÉ 6.33. LISTBOX_QUERY_COUNT ΓòÉΓòÉΓòÉ
  1375.  
  1376. Return the number of items in a listbox 
  1377. Syntax 
  1378.  
  1379.     rc = LISTBOX_QUERY_COUNT(seq_number, variable_name)
  1380.          where seq_number is the sequence number identifying the listbox.
  1381.  
  1382.  
  1383. Examples 
  1384.  
  1385.        /* How many items in the first listbox? */
  1386.        rc =  LISTBOX_QUERY_COUNT("1", "item_count")
  1387.        say item_count 'items in the listbox'
  1388.  
  1389. Description 
  1390.  
  1391. This call returns the number of items in the listbox. 
  1392.  
  1393.  
  1394. ΓòÉΓòÉΓòÉ 6.34. LISTBOX_QUERY_TEXT ΓòÉΓòÉΓòÉ
  1395.  
  1396. Returns the text of the specified item in the specified listbox. 
  1397. Syntax 
  1398.  
  1399.     rc = LISTBOX_QUERY_TEXT(seq_number, item_number, variable_name)
  1400.          where seq_number is the sequence number identifying the listbox,
  1401.          and item_number identifies the item.
  1402.  
  1403.  
  1404. Examples 
  1405.  
  1406.        /* Get the text of the third item in the second listbox */
  1407.        rc =  LISTBOX_QUERY_TEXT("2", "3", "txt")
  1408.        say "Text is " txt
  1409.  
  1410. Description 
  1411.  
  1412. This function returns the text of the specified item in the specified listbox. 
  1413. Notes 
  1414.  
  1415.  The text of the listbox cannot be queried if the listbox has the OWNERDRAW 
  1416.  style. 
  1417.  
  1418.  Return Codes 
  1419.  
  1420.  o 5 - Query failed. Listbox has OWNERDRAW style 
  1421.  
  1422.  o 6 - Query failed. Probably item number is out of range 
  1423.  
  1424.  
  1425. ΓòÉΓòÉΓòÉ 6.35. MENU_QUERY_ALL ΓòÉΓòÉΓòÉ
  1426.  
  1427. Returns the text of each menu item at the specified level. 
  1428. Syntax 
  1429.  
  1430.     rc =  MENU_QUERY_ALL([level1,] [level2,] [level3,] stem_variable_name)
  1431.          where levels specify the point in the menu hierarchy to list items
  1432.          from.
  1433.  
  1434.  
  1435. Examples 
  1436.  
  1437.        /* Get contents of the action bar */
  1438.        rc =  MENU_QUERY_ALL("actionbar")
  1439.        if rc = 0 then
  1440.           do i = 1 to actionbar.0
  1441.              say 'Action bar item 'i 'is :'actionbar.i
  1442.              end
  1443.        /* Get the contents of the Options action bar item */
  1444.        rc =  MENU_QUERY_ALL("~Options","options")
  1445.        if rc = 0 then
  1446.           do i = 1 to options.0
  1447.              say 'Option choice 'i 'is :'options.i
  1448.              end
  1449.  
  1450.  
  1451. Description 
  1452.  
  1453. This function returns the text of each of the action bar items at the specified 
  1454. level starting from the actionbar. 
  1455. Notes 
  1456.  
  1457.  The returned text for any menu item may contain mnemonic indicators. For 
  1458.  example in the above example, the tilde will appear in front of the mnemonic 
  1459.  character O in Options. 
  1460.  
  1461.  On input, however, the tilde is not necessary, and only the prefix of the 
  1462.  menuitem text needs to be specified. 
  1463.  
  1464.  
  1465. ΓòÉΓòÉΓòÉ 6.36. MENU_QUERY_STATE ΓòÉΓòÉΓòÉ
  1466.  
  1467. Returns information about the state of a menu item at the specified level. 
  1468. Syntax 
  1469.  
  1470.     rc =  MENU_QUERY_STATE([level1,] [level2,] [level3,] stem_variable_name)
  1471.          where levels specify the point in the menu hierarchy.
  1472.  
  1473.  
  1474. Examples 
  1475.  
  1476.        /* Get state of a menuitem in the action bar */
  1477.        rc =  MENU_QUERY_STATE("Options","Centered","state")
  1478.        if rc = 0 then do
  1479.           say 'Check   status: 'state.1
  1480.           say 'Hilite  status: 'state.2
  1481.           say 'Enable  status: 'state.3
  1482.           end
  1483.  
  1484.  
  1485. Description 
  1486.  
  1487. This function returns updates the stem variable specified in the last parameter 
  1488. as follows. The .1 stem indicates the checked status and is either "CHECKED" or 
  1489. "UNCHECKED". The .2 stem indicates the hilite status and is either "HILITED" or 
  1490. "UNHILITED". The .3 stem indicates the enabled status and is either "ENABLED" 
  1491. or "DISABLED" 
  1492.  
  1493.  
  1494. ΓòÉΓòÉΓòÉ 6.37. MENU_SELECT ΓòÉΓòÉΓòÉ
  1495.  
  1496. Selects the specified menu item. 
  1497. Syntax 
  1498.  
  1499.     rc =  MENU_SELECT( level1   [,level2] [,level3] )
  1500.          where levels identify the menu item to be selected.
  1501.  
  1502.  
  1503. Examples 
  1504.  
  1505.        /* Select the File option of the action bar */
  1506.        rc =  MENU_SELECT("F~ile")
  1507.        rc =  MENU_SELECT("File")         /* This will match also    */
  1508.        rc =  MENU_SELECT("Fi")           /* This too                */
  1509.        /* Select the "Grid" choice of the "Options" action bar item */
  1510.        rc =  MENU_SELECT("~Options","G~rid")
  1511.        rc =  MENU_SELECT("Options","Grid")/* This will match also   */
  1512.  
  1513.  
  1514. Description 
  1515.  
  1516. This function selects the specified item at the level specified starting from 
  1517. the actionbar. 
  1518. Notes 
  1519.  
  1520.  The matching is case sensitive, but the tilde is not needed, and only the 
  1521.  prefix needs to be specified. 
  1522.  
  1523.  Return Codes 
  1524.  
  1525.  o 5 - Select failed. Menu item disabled or invalid. 
  1526.  
  1527.  
  1528. ΓòÉΓòÉΓòÉ 6.38. MLE_HOW_MANY ΓòÉΓòÉΓòÉ
  1529.  
  1530. Return the number of multi line entryfields. 
  1531. Syntax 
  1532.  
  1533.     rc = MLE_HOW_MANY( variable_name)
  1534.  
  1535.  
  1536. Examples 
  1537.  
  1538.        /* How many MLE controls                   */
  1539.        rc = MLE_HOW_MANY( "count")
  1540.        say "number of MLE controls: " count
  1541.  
  1542. Description 
  1543.  
  1544. This function returns a variable which contains the number of MLE controls in 
  1545. the selected window. 
  1546.  
  1547.  
  1548. ΓòÉΓòÉΓòÉ 6.39. MLE_QUERY_TEXT ΓòÉΓòÉΓòÉ
  1549.  
  1550. Query the text of an multi line entry field. 
  1551. Syntax 
  1552.  
  1553.     rc =  MLE_QUERY_TEXT(seq_number, variable_name)
  1554.          where seq_number is the sequence number identifying the MLE.
  1555.  
  1556.  
  1557. Examples 
  1558.  
  1559.        /* Look at the items of the second MLE      */
  1560.        rc = MLE_QUERY_TEXT("2", "txt")
  1561.        say txt
  1562.  
  1563. Description 
  1564.  
  1565. This function returns a variable which contains the text of the specified MLE. 
  1566.  
  1567.  
  1568. ΓòÉΓòÉΓòÉ 6.40. MLE_SET_TEXT ΓòÉΓòÉΓòÉ
  1569.  
  1570. Set the text of an MLE field. 
  1571. Syntax 
  1572.  
  1573.     rc = MLE_SET_TEXT( seq_number, text)
  1574.          where seq_number is the sequence number identifying the MLE field,
  1575.          and text is what it should be set to.
  1576.  
  1577.  
  1578. Examples 
  1579.  
  1580.        /* Set the value of the first MLE field      */
  1581.        rc = MLE_SET_TEXT("1", "MYAPP.EXE")
  1582.  
  1583. Description 
  1584.  
  1585. This function sets the MLE field as specified. APMT will not update the field 
  1586. if it is not input enabled. 
  1587. Return Codes 
  1588.  
  1589.  o 6 - The field is not enabled. 
  1590.  
  1591.  
  1592. ΓòÉΓòÉΓòÉ 6.41. NOTEBOOK_PUSHTAB ΓòÉΓòÉΓòÉ
  1593.  
  1594. Simulates clicking on the specified tab of a notebook. 
  1595. Syntax 
  1596.  
  1597.     rc = NOTEBOOK_PUSHTAB(seq_number, id)
  1598.          where seq_number is the sequence number of the notebook,
  1599.          and id is the text of the tab.
  1600.  
  1601.  
  1602. Examples 
  1603.  
  1604.        /* Select the 'Fonts' page */
  1605.        rc = NOTEBOOK_PUSHTAB("1", "Fonts")
  1606.  
  1607. Description 
  1608.  
  1609. This function simulates the clicking on the tab of a notebook page. 
  1610. Return Codes 
  1611.  
  1612.  o 5 - Tab not found. 
  1613.  
  1614.  
  1615. ΓòÉΓòÉΓòÉ 6.42. NOTEBOOK_QUERY_TABS ΓòÉΓòÉΓòÉ
  1616.  
  1617. Return the information on all tabs of a notebook. 
  1618. Syntax 
  1619.  
  1620.     rc = NOTEBOOK_QUERY_TABS(seq_number,stem_variable_name)
  1621.  
  1622. Examples 
  1623.  
  1624.        /* List all the tabs of the notebook       */
  1625.        rc = NOTEBOOK_QUERY_TABS(1,"tabs")
  1626.        say "number of tabs: " tabs.0
  1627.        do i = 1 to tabs.0
  1628.           say 'Tab 'i 'is: 'tabs.i
  1629.           end
  1630.  
  1631. Description 
  1632.  
  1633. This function returns a stem variable which contains the information on all the 
  1634. tabs of the specified notebook. The .0 stem contains the number of tabs, and 
  1635. the .i stem contains the text of the i-th tab. 
  1636.  
  1637.  
  1638. ΓòÉΓòÉΓòÉ 6.43. POPUPMENU_QUERY_ALL ΓòÉΓòÉΓòÉ
  1639.  
  1640. Returns the text of each popup menu item at the specified level. 
  1641. Syntax 
  1642.  
  1643.     rc =  POPUPMENU_QUERY_ALL([level1,] [level2,] [level3,] stem_variable_name)
  1644.          where levels specify the point in the menu hierarchy to list items
  1645.          from.
  1646.  
  1647.  
  1648. Description 
  1649.  
  1650. This function is similar to MENU_QUERY_ALL, except that it operates on a open 
  1651. popup menu. It is assumed that action such SHIFT+F10 has been issued to cause a 
  1652. popup prior to invoking this call. 
  1653.  
  1654.  
  1655. ΓòÉΓòÉΓòÉ 6.44. POPUPMENU_QUERY_STATE ΓòÉΓòÉΓòÉ
  1656.  
  1657. Returns information about the state of a POPUPMENU item at the specified level. 
  1658. Syntax 
  1659.  
  1660.     rc =  POPUPMENU_QUERY_ALL([level1,] [level2,] [level3,] stem_variable_name)
  1661.          where levels specify the point in the POPUPMENU hierarchy.
  1662.  
  1663.  
  1664. Description 
  1665.  
  1666. This function is similar to MENU_QUERY_STATE, except that it operates on a open 
  1667. popup menu. It is assumed that action such SHIFT+F10 has been issued to cause a 
  1668. popup prior to invoking this call. 
  1669.  
  1670.  
  1671. ΓòÉΓòÉΓòÉ 6.45. POPUPMENU_SELECT ΓòÉΓòÉΓòÉ
  1672.  
  1673. Selects the specified menu item from the popup menu window. 
  1674. Syntax 
  1675.  
  1676.     rc =  POPUPMENU_SELECT( level1   [,level2] [,level3] )
  1677.          where levels identify the menu item to be selected.
  1678.  
  1679.  
  1680. Description 
  1681.  
  1682. This function is similar to MENU_SELECT, except that it operates on a open 
  1683. popup menu. It is assumed that action such SHIFT+F10 has been issued to cause a 
  1684. popup prior to invoking this call. 
  1685. Return Codes 
  1686.  
  1687.  o 5 - Popup menu item disabled or invalid. 
  1688.  
  1689.  
  1690. ΓòÉΓòÉΓòÉ 6.46. PUSHBUTTON_CLICK ΓòÉΓòÉΓòÉ
  1691.  
  1692. Simulates clicking of the specified pushbutton. 
  1693. Syntax 
  1694.  
  1695.     rc = PUSHBUTTON_CLICK(id[,seq_number])
  1696.          where id is the text of the checkbox,
  1697.          and seq_number is the sequence number of the pushbutton with the same id.
  1698.  
  1699.  
  1700. Examples 
  1701.  
  1702.        /* Click on Search */
  1703.        rc = PUSHBUTTON_CLICK("Search")
  1704.        /* Click on the third pushbutton with a blank title */
  1705.        rc = PUSHBUTTON_CLICK(" ",3)
  1706.  
  1707. Description 
  1708.  
  1709. This function simulates the clicking on a pushbutton. The seq_number is 
  1710. optional and defaults to 1. It is needed only if the window has more than one 
  1711. pushbutton with the same id. 
  1712.  
  1713.  
  1714. ΓòÉΓòÉΓòÉ 6.47. PUSHBUTTON_QUERY_ALL ΓòÉΓòÉΓòÉ
  1715.  
  1716. Return the information on all pushbuttons. 
  1717. Syntax 
  1718.  
  1719.     rc =  PUSHBUTTON_QUERY_ALL(stem_variable_name)
  1720.  
  1721.  
  1722. Examples 
  1723.  
  1724.        /* How many pushbuttons?                          */
  1725.        rc = PUSHBUTTON_QUERY_ALL( "buttons")
  1726.        say "number of pushbuttons: " buttons.0
  1727.        do i = 1 to buttons.0
  1728.           say 'button no 'i 'is: 'buttons.i
  1729.           end
  1730.  
  1731. Description 
  1732.  
  1733. This function returns a stem variable which contains the information on all the 
  1734. pushbuttons in the selected window. The .0 stem contains the number of 
  1735. pushbuttons, and the .i stem contains the text of the i-th pushbutton. If the 
  1736. pushbutton is disabled, then the text is followed by the word '*DISABLED*'. 
  1737.  
  1738.  
  1739. ΓòÉΓòÉΓòÉ 6.48. RADIOBUTTON_CLICK ΓòÉΓòÉΓòÉ
  1740.  
  1741. This function causes the specified radiobutton to be clicked. 
  1742. Syntax 
  1743.  
  1744.     rc =  RADIOBUTTON_CLICK(id[,seq_number])
  1745.          where id is the text identifying the radiobutton,
  1746.          and seq_number is the sequence number of the radiobutton with the id.
  1747.  
  1748. Examples 
  1749.  
  1750.     /* Click on the radiobutton "red" */
  1751.     rc = RADIOBUTTON_CLICK("red")
  1752.  
  1753.     /* There are three "red" radiobuttons, press the third one  */
  1754.     rc = RADIOBUTTON_CLICK("red",3)
  1755.  
  1756. Description 
  1757.  
  1758. As a result of this call the specified radiobutton will go to selected state. 
  1759.  
  1760. The second parameter is optional and defaults to 1. It is needed only if the 
  1761. window has more than one radiobutton with the same id. 
  1762.  
  1763.  
  1764. ΓòÉΓòÉΓòÉ 6.49. RADIOBUTTON_QUERY_ALL ΓòÉΓòÉΓòÉ
  1765.  
  1766. Return the information on all radiobuttons. 
  1767. Syntax 
  1768.  
  1769.     rc =  RADIOBUTTON_QUERY_ALL(stem_variable_name)
  1770.  
  1771.  
  1772. Examples 
  1773.  
  1774.        /* How many radiobuttons?                          */
  1775.        rc = RADIOBUTTON_QUERY_ALL( "button")
  1776.        say "number of radiobuttons: " button.0
  1777.        do i = 1 to buttons.0
  1778.           say 'radiobutton no 'i 'is: 'button.i
  1779.           end
  1780.  
  1781. Description 
  1782.  
  1783. This function returns a stem variable which contains the information on all the 
  1784. radiobuttons in the selected window. 
  1785.  
  1786.  
  1787. ΓòÉΓòÉΓòÉ 6.50. RADIOBUTTON_QUERY_STATE ΓòÉΓòÉΓòÉ
  1788.  
  1789. Return the checked, and enable status of the specified radiobutton. 
  1790. Syntax 
  1791.  
  1792.     rc = RADIOBUTTON_QUERY_STATE(id, stem_variable_name)
  1793.          where id is the text identifying the radiobutton.
  1794.  
  1795.  
  1796. Examples 
  1797.  
  1798.        /* return the status of the "D" radiobutton */
  1799.        rc = RADIOBUTTON_QUERY_STATE("D","state")
  1800.        if state.1 = 'CHECKED' then say 'selected'
  1801.        if state.2 = 'DISABLED' then say 'disabled'
  1802.  
  1803. Description 
  1804.  
  1805. This function returns updates the stem variable specified in the last parameter 
  1806. as follows. The .1 stem indicates the checked status and is either "CHECKED" or 
  1807. "UNCHECKED". The .2 stem indicates the enabled status and is either "ENABLED" 
  1808. or "DISABLED". 
  1809.  
  1810.  
  1811. ΓòÉΓòÉΓòÉ 6.51. SPINBUTTON_QUERY_LIMITS ΓòÉΓòÉΓòÉ
  1812.  
  1813. Return the limits of the values of the specified spinbutton. 
  1814. Syntax 
  1815.  
  1816.     rc =  SPINBUTTON_QUERY_LIMITS(seq_number, stem_variable_name)
  1817.          where seq_number is the sequence number identifying the SPINBUTTON.
  1818.  
  1819.  
  1820. Examples 
  1821.  
  1822.        /* return the limits of the second spinbutton */
  1823.        rc = SPINBUTTON_QUERY_LIMITS("2","limits")
  1824.        say 'Lower limit is 'limits.1
  1825.        say 'Upper limit is 'limits.2
  1826.  
  1827. Description 
  1828.  
  1829. This function returns the limits of the specified spinbutton. Stem .0 of the 
  1830. returned variable is always 2. Stems .1 and .2 contain the lower and upper 
  1831. limits. 
  1832. Notes 
  1833.  
  1834.  This function does not seem to work under OS/2 2.0, possibly because of a PM 
  1835.  bug. It has been found to work under OS/2 2.1. 
  1836.  
  1837.  Return Codes 
  1838.  
  1839.  o 5 - Limits could not be determined. Spinbutton is probably disabled. 
  1840.  
  1841.  
  1842. ΓòÉΓòÉΓòÉ 6.52. SPINBUTTON_QUERY_TEXT ΓòÉΓòÉΓòÉ
  1843.  
  1844. Query the text of a spinbutton control. 
  1845. Syntax 
  1846.  
  1847.     rc =  SPINBUTTON_QUERY_TEXT(seq_number, variable_name)
  1848.          where seq_number is the sequence number identifying the SPINBUTTON.
  1849.  
  1850.  
  1851. Examples 
  1852.  
  1853.        /* Look at the text of the first SPINBUTTON      */
  1854.        rc = SPINBUTTON_QUERY_TEXT("1", "txt")
  1855.        say txt
  1856.  
  1857. Description 
  1858.  
  1859. This function returns a variable which contains the text of the specified 
  1860. SPINBUTTON. 
  1861.  
  1862.  
  1863. ΓòÉΓòÉΓòÉ 6.53. SPINBUTTON_SPINDOWN ΓòÉΓòÉΓòÉ
  1864.  
  1865. Spin the spinbutton down one unit. 
  1866. Syntax 
  1867.  
  1868.     rc =  SPINBUTTON_SPINDOWN(seq_number)
  1869.          where seq_number is the sequence number identifying the SPINBUTTON.
  1870.  
  1871.  
  1872. Examples 
  1873.  
  1874.        /* Spin down the first spinbutton, and look at the text     */
  1875.        rc =  SPINBUTTON_SPINDOWN("1")
  1876.        rc =  SPINBUTTON_QUERY_TEXT("1", "txt")
  1877.        say txt
  1878.  
  1879. Description 
  1880.  
  1881. This function causes the down button to be clicked. 
  1882. Return Codes 
  1883.  
  1884.  o 5 - Function did not be work. Spinbutton is probably disabled. 
  1885.  
  1886.  
  1887. ΓòÉΓòÉΓòÉ 6.54. SPINBUTTON_SPINUP ΓòÉΓòÉΓòÉ
  1888.  
  1889. Spin the spinbutton up one unit. 
  1890. Syntax 
  1891.  
  1892.     rc =  SPINBUTTON_SPINUP(seq_number)
  1893.          where seq_number is the sequence number identifying the SPINBUTTON.
  1894.  
  1895.  
  1896. Examples 
  1897.  
  1898.        /* Spin up the first spinbutton, and look at the text     */
  1899.        rc =  SPINBUTTON_SPINUP("1")
  1900.        rc =  SPINBUTTON_QUERY_TEXT("1", "txt")
  1901.        say txt
  1902.  
  1903. Description 
  1904.  
  1905. This function causes the up button to be clicked. 
  1906. Return Codes 
  1907.  
  1908.  o 5 - Function did not be work. Spinbutton is probably disabled. 
  1909.  
  1910.  
  1911. ΓòÉΓòÉΓòÉ 6.55. SYSMENU_QUERY_ALL ΓòÉΓòÉΓòÉ
  1912.  
  1913. Returns the text of each sysmenu item at the specified level. 
  1914. Syntax 
  1915.  
  1916.     rc =  SYSMENU_QUERY_ALL([level1,] [level2,] [level3,] stem_variable_name)
  1917.          where levels specify the point in the menu hierarchy to list items
  1918.          from.
  1919.  
  1920.  
  1921. Description 
  1922.  
  1923. This function is similar to MENU_QUERY_ALL, except that it operates on a 
  1924. sysmenu. 
  1925.  
  1926.  
  1927. ΓòÉΓòÉΓòÉ 6.56. SYSMENU_QUERY_STATE ΓòÉΓòÉΓòÉ
  1928.  
  1929. Returns information about the state of a sysmenu item at the specified level. 
  1930. Syntax 
  1931.  
  1932.     rc =  SYSMENU_QUERY_ALL([level1,] [level2,] [level3,] stem_variable_name)
  1933.          where levels specify the point in the sysmenu hierarchy.
  1934.  
  1935.  
  1936. Description 
  1937.  
  1938. This function is similar to MENU_QUERY_STATE, except that it operates on a 
  1939. sysmenu. 
  1940.  
  1941.  
  1942. ΓòÉΓòÉΓòÉ 6.57. SYSMENU_SELECT ΓòÉΓòÉΓòÉ
  1943.  
  1944. Selects the specified menu item from the sysmenu window. 
  1945. Syntax 
  1946.  
  1947.     rc =  SYSMENU_SELECT( level1   [,level2] [,level3] )
  1948.          where levels identify the menu item to be selected.
  1949.  
  1950.  
  1951. Description 
  1952.  
  1953. This function is similar to MENU_SELECT, except that it operates on the 
  1954. sysmenu. 
  1955. Return Codes 
  1956.  
  1957.  o 5 - Sysmenu item disabled or invalid. 
  1958.  
  1959.  
  1960. ΓòÉΓòÉΓòÉ 6.58. TEXT_HOW_MANY ΓòÉΓòÉΓòÉ
  1961.  
  1962. Return the number of static text fields. 
  1963. Syntax 
  1964.  
  1965.     rc = TEXT_HOW_MANY( variable_name)
  1966.  
  1967.  
  1968. Examples 
  1969.  
  1970.        /* How many static text fields?                          */
  1971.        rc = TEXT_HOW_MANY( "count")
  1972.        say "number of static text fields: " count
  1973.  
  1974. Description 
  1975.  
  1976. This function returns a variable which contains the number of static text 
  1977. controls in the selected window. 
  1978.  
  1979.  
  1980. ΓòÉΓòÉΓòÉ 6.59. TEXT_QUERY_TEXT ΓòÉΓòÉΓòÉ
  1981.  
  1982. Query the text of a static text field. 
  1983. Syntax 
  1984.  
  1985.     rc = TEXT_QUERY_TEXT(seq_number, variable_name)
  1986.          where seq_number is the sequence number identifying the static field.
  1987.  
  1988.  
  1989. Examples 
  1990.  
  1991.        /* Get the text of the first static text field      */
  1992.        rc = TEXT_QUERY_TEXT("1", "txt")
  1993.        say txt
  1994.  
  1995. Description 
  1996.  
  1997. This function returns a variable which contains the text of the specified 
  1998. static text field. 
  1999.  
  2000.  
  2001. ΓòÉΓòÉΓòÉ 7. The APMT Mouse Functions ΓòÉΓòÉΓòÉ
  2002.  
  2003. This section describes those functions that are related mouse event simulation. 
  2004. This is at current experimental, and subject to change. 
  2005.  
  2006. Mouse event simulation is done by first using a function to place the pointer 
  2007. at the desired location, and then calling a function to play a mouse button 
  2008. event. For example, to simulate a drag and drop, at least four calls will be 
  2009. needed - set_pointer, button_down, set_pointer, and button up. 
  2010.  
  2011.  
  2012. ΓòÉΓòÉΓòÉ 7.1. MOUSE ΓòÉΓòÉΓòÉ
  2013.  
  2014. Simulate a mouse action at the current pointer position. 
  2015. Syntax 
  2016.  
  2017.     rc = MOUSE(action, button_identifier)
  2018.          where action defines the mouse action to be simulated, and
  2019.          button_identifier defines which button(s) to use.
  2020.  
  2021.  
  2022. Examples 
  2023.  
  2024.        rc = MOUSE("CLICK","1")        /* click        button 1 */
  2025.        rc = MOUSE("DCLICK","2")       /* double click button 2 */
  2026.        rc = MOUSE("CLICK","12")       /* click button 1,2 together*/
  2027.        rc = MOUSE("CLICK","21")       /* click button 1,2 together*/
  2028.  
  2029. Description 
  2030.  
  2031. This function will simulate the mouse event, without changing the pointer 
  2032. position. 
  2033.  
  2034. The following actions are supported. These are to be specified exactly. 
  2035.  
  2036.  o CLICK 
  2037.  
  2038.  o DCLICK 
  2039.  
  2040.  o DOWN 
  2041.  
  2042.  o UP 
  2043.  
  2044.  Notes 
  2045.  
  2046.  It is expected that the pointer is placed correctly, before invoking this 
  2047.  function. Some functions to set the pointer are described in this section. 
  2048.  
  2049.  Return Codes 
  2050.  
  2051.  o 5 - Invalid parameter 
  2052.  
  2053.  
  2054. ΓòÉΓòÉΓòÉ 7.2. FRAME_SET_POINTER ΓòÉΓòÉΓòÉ
  2055.  
  2056. Position the pointer at a specified position relative to the frame. 
  2057. Syntax 
  2058.  
  2059.     rc = FRAME_SET_POINTER(location [,x][,X][,y][,Y])
  2060.          where location the area of the frame, and the remaining
  2061.          parameters define the position within the frame, in the
  2062.          case when location is inside.
  2063.  
  2064.  
  2065. Examples 
  2066.  
  2067.        rc = FRAME_SET_POINTER("TR")   /* place on upper right corner */
  2068.        rc = FRAME_SET_POINTER("T")    /* place on upper side         */
  2069.        rc = FRAME_SET_POINTER("BL")   /* place on lower left corner  */
  2070.        rc = FRAME_SET_POINTER("M")    /* at midpoint inside the frame */
  2071.        rc = FRAME_SET_POINTER("M",4,10,6,10) /* at pos 4,6 on a 10x10 grid */
  2072.        rc = FRAME_SET_POINTER("M",4,10)      /* at pos 4,1 on a 10x1 grid  */
  2073.  
  2074. Description 
  2075.  
  2076. This function will place the pointer at the specified location. If the first 
  2077. parameter is "M" then additional parameters may be specified as described 
  2078. below, otherwise the additional parameters will be ignored. 
  2079.  
  2080. The following values of the first parameter are supported: 
  2081.  
  2082.  "R"  - RIGHT  side of the frame 
  2083.  
  2084.  "W"  - LEFT  side of the frame 
  2085.  
  2086.  "T"  - TOP   side of the frame 
  2087.  
  2088.  "B"  - BOTTOM side of the frame 
  2089.  
  2090.  "TR" - TOP RIGHT corner of the frame 
  2091.  
  2092.  "TL" - TOP LEFT corner of the frame 
  2093.  
  2094.  "BL" - BOTTOM LEFT corner of the frame 
  2095.  
  2096.  "BR" - BOTTOM RIGHT corner of the frame 
  2097.  
  2098.  "M"  - Inside the frame 
  2099.  
  2100.  The 2nd through 5th parameters, if specified, are used as follows. The frame 
  2101.  window is divided into an imaginary grid of dimension (X,Y). The pointer is 
  2102.  then placed in the middle of the (x,y) cell of this grid. 
  2103.  Notes 
  2104.  
  2105.  If the first parameter is not recognized, "M" is assumed. 
  2106.  
  2107.  
  2108. ΓòÉΓòÉΓòÉ 7.3. CLASS_SET_POINTER ΓòÉΓòÉΓòÉ
  2109.  
  2110. Position the pointer at a specified position in a user defined control. 
  2111. Syntax 
  2112.  
  2113.     rc = CLASS_SET_POINTER(classname [,x][,X][,y][,Y])
  2114.          where classname is the name of a user defined control, and the remaining
  2115.          defines the position within the window.
  2116.  
  2117.  
  2118. Examples 
  2119.  
  2120.        rc = CLASS_SET_POINTER("MyButton") /* place at center of user defined */
  2121.                                           /* button (of class MyButton)      */
  2122.  
  2123. Description 
  2124.  
  2125. This function will place the pointer at the specified location, inside the 
  2126. control window belonging to the class specified in the first parameter. The 
  2127. matching is exact. 
  2128.  
  2129. The 2nd through 5th parameters, if specified, are used as follows. The 
  2130. specified control window is divided into an imaginary grid of dimension (X,Y). 
  2131. The pointer is then placed in the middle of the (x,y) cell of this grid. 
  2132. Notes 
  2133.  
  2134.  To be able to use this function, you have to know the name of the user defined 
  2135.  (non-standard) control. You can use the PMTREE tool to determine this. 
  2136.  
  2137.  
  2138. ΓòÉΓòÉΓòÉ 7.4. CONTAINER_SET_POINTER ΓòÉΓòÉΓòÉ
  2139.  
  2140. Place the pointer on the specified container object. 
  2141. Syntax 
  2142.  
  2143.     rc = CONTAINER_SET_POINTER(seq_number, object_identifier)
  2144.          where seq_number is the sequence number identifying the container,
  2145.          and object_identifier is
  2146.              either the text string identifying the object
  2147.              or #n with n = the object number
  2148.  
  2149.  
  2150. Examples 
  2151.  
  2152.        rc = CONTAINER_SET_POINTER(1, "Main")
  2153.        rc = CONTAINER_SET_POINTER(1, "#5")
  2154.  
  2155.  
  2156. Description 
  2157.  
  2158. This function will first try to place the pointer on the icon rectangle of the 
  2159. selected container object. If unsuccessful, attempt will be made to place the 
  2160. pointer on the text rectangle. 
  2161.  
  2162.  
  2163.  
  2164. Notes 
  2165.  
  2166.  If the object is not visible, attempt will be made to bring the object into 
  2167.  the visible area by scrolling the container. 
  2168.  
  2169.  Return Codes 
  2170.  
  2171.  o 5 - No matching object found. 
  2172.  
  2173.  o 6 - Could not get rectangle of icon or text. 
  2174.