home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / thes4000.zip / theseus.zip / THES4000.EXE / getlinmp.cmd next >
OS/2 REXX Batch file  |  2000-05-16  |  3KB  |  76 lines

  1. /* */
  2. /*============================================================================+
  3. |    This .CMD calls Theseus1.dll for RT2GetLInMemMap.                        |
  4. +============================================================================*/
  5. trace o
  6.  
  7. secs        = 5;
  8. iterations  = 1;
  9. found       = false;
  10. pid_num     = false;
  11.  
  12. /*==================================================================+
  13. |   Parse the input arguements to upper case.                       |
  14. +==================================================================*/
  15. PARSE UPPER ARG p_iterations p_secs
  16.  
  17. /*==================================================================+
  18. |   Check to see if any operand have been passed. If Not exit.      |
  19. +==================================================================*/
  20. IF p_iterations = '?' | p_iterations = "HELP" THEN
  21. DO
  22.    SAY 'CMD file GETMEMMP does not need any input operands.'
  23.    SAY ''
  24.    SAY '   Optional operands are multiple re-iterations of output.'
  25.    SAY '  GETMEMCP [num_iterations] [num_secs]'
  26.    SAY ''
  27.    SAY '   Where:'
  28.    SAY '     num_iterations - is the number of data collections for this run.'
  29.    SAY '                      DEFAULT is 1 iteration.'
  30.    SAY '     num_secs       - is the number of seconds between interations.'
  31.    SAY '                      DEFAULT is 5 seconds.'
  32.    EXIT 999
  33. END
  34.  
  35. /*==================================================================+
  36. |   Check operand to see if any have been defaulted.                |
  37. +==================================================================*/
  38. IF p_secs \= '' THEN secs = STRIP(p_secs);
  39. IF p_iterations \= '' THEN iterations = p_iterations
  40.  
  41. /*==================================================================+
  42. |   The following loads the necessary REXX functions and Theseus2   |
  43. | functions.                                                        |
  44. +==================================================================*/
  45. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  46. call SysLoadFuncs
  47.  
  48. call RxFuncAdd 'RT2LoadFuncs1', 'THESEUS1', 'RT2LoadFuncs1'
  49. rc = RT2LoadFuncs1()
  50. IF rc \= 0 THEN Say 'RT2loadfuncs1 rc is = 'rc
  51.  
  52. /*==================================================================+
  53. |   After all parms have been checked and a pid found then loop     |
  54. | for the number of iterations for the duration of seconds between  |
  55. | iterations.                                                       |
  56. +==================================================================*/
  57. DO
  58.    DO i = 1 TO iterations BY 1
  59.       rc = RT2GetLinMemMap( )
  60.       if rc = 0 THEN
  61.       DO
  62.          SAY 'Data collected for Linear memory map at 'time()', on 'date(Language)'.'
  63.          SAY ''
  64.          SAY ''
  65.          call SysSleep secs
  66.       END
  67.       ELSE
  68.       DO
  69.          SAY 'Return code 'rc 'from RT2GetLinMemMap.'
  70.          EXIT
  71.       END
  72.    END
  73. END
  74. SAY 'GETMEMMP has terminated.  The time is 'time()', the date is 'date(Language)'.'
  75. EXIT
  76.