home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rox.zip / testcoll.cmd < prev    next >
OS/2 REXX Batch file  |  1993-08-31  |  1KB  |  70 lines

  1. /*------------------------------------------------------------------
  2.  * test1.cmd :
  3.  *------------------------------------------------------------------
  4.  * 08-20-93 originally by Patrick J. Mueller
  5.  *------------------------------------------------------------------*/
  6.  
  7. parse arg class roxName .
  8.  
  9. if (class = "") then
  10.    class = "list"
  11.  
  12. if (roxName = "") then
  13.    roxName = class
  14.  
  15. say "testing '"class"' class"
  16.  
  17. if RxFuncQuery("RoxLoadFuncs") then
  18.    do
  19.    rc = RxFuncAdd("RoxLoadFuncs","Rox","RoxLoadFuncs")
  20.    rc = RoxLoadFuncs()
  21.    end
  22.  
  23. rc = time("r")
  24.  
  25. rc = RoxLoad(class".rox")
  26.  
  27. coll1 = RoxCreate(class)
  28. coll2 = RoxCreate(class)
  29.  
  30. items = 10
  31.  
  32. do i = 1 to items
  33.    say "adding to coll1:" i
  34.    g = .add(coll1,i)
  35. end
  36. say
  37.  
  38. do i = 1 to items
  39.    say "adding to coll2:" i * i
  40.    g = .add(coll2,i*i)
  41. end
  42. say
  43.  
  44. say "testing in coll1 for 3"
  45. if (0 = .includes(coll1,3)) then
  46.    say "error finding 3 in coll1"
  47.  
  48. say "testing in coll2 for 9"
  49. if (0 = .includes(coll2,9)) then
  50.    say "error finding 9 in coll2"
  51.  
  52. say
  53.  
  54. say "printing coll1"
  55. say .do(coll1,"!item","!coll=!coll !item","!coll=''","return space(!coll)")
  56. say
  57.  
  58. say "printing coll2"
  59. say .do(coll2,"!item","!coll=!coll !item","!coll=''","return space(!coll)")
  60. say
  61.  
  62.  
  63. rc = RoxDestroy(coll1)
  64. rc = RoxDestroy(coll2)
  65.  
  66. elapsed = time("e")
  67.  
  68. say
  69. say "Total processing time:" elapsed "seconds".
  70.