home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rox.zip / list.rox < prev    next >
Text File  |  1994-04-08  |  1KB  |  57 lines

  1. :*------------------------------------------------------------------
  2. :* REXX Object eXtensions : list class
  3. :*------------------------------------------------------------------
  4.  
  5. :class list
  6.  
  7. :include collect.rox
  8.  
  9. :inherits collection
  10.  
  11. :*------------------------------------------------------------------
  12. :* create a list
  13. :*------------------------------------------------------------------
  14. :method init
  15.  
  16.    item.0 = 0
  17.  
  18.    rc = RoxAddVar(self,"item.0")
  19.  
  20.    return ""
  21.  
  22. :*------------------------------------------------------------------
  23. :* return number of items
  24. :*------------------------------------------------------------------
  25. :method size
  26.    return item.0
  27.  
  28. :*------------------------------------------------------------------
  29. :* add an item to the list
  30. :*------------------------------------------------------------------
  31. :method add
  32.  
  33.    o = item.0 + 1
  34.    item.0 = o
  35.    item.o = arg(1)
  36.  
  37.    rc = RoxAddVar(self,"item."o)
  38.  
  39.    return self
  40.  
  41. :*------------------------------------------------------------------
  42. :* get an item
  43. :*------------------------------------------------------------------
  44. :method atIndex
  45.    index = arg(1)
  46.  
  47.    return item.index
  48.  
  49. :*------------------------------------------------------------------
  50. :* get an item
  51. :*------------------------------------------------------------------
  52. :method at
  53.    index = arg(1)
  54.  
  55.    return item.index
  56.  
  57.