home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / dataflex / monarray.pkg < prev    next >
Encoding:
Text File  |  1993-08-10  |  2.3 KB  |  83 lines

  1. //************************************************************************
  2. //
  3. // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
  4. // All Rights reserved
  5. // DataFlex is a registered trademark of Data Access Corporation.
  6. //
  7. //
  8. //     $Source: /u3/source.30/product/pkg/RCS/monarray.pkg,v $
  9. //     $Revision: 1.1 $
  10. //     $State: Exp $
  11. //     $Author: james $
  12. //     $Date: 1992/09/08 14:43:07 $
  13. //     $Locker:  $
  14. //
  15. //     $Log: monarray.pkg,v $
  16. //Revision 1.1  1992/09/08  14:43:07  james
  17. //Initial revision
  18. //
  19. //Revision 1.3  92/05/14  15:50:37  unknown
  20. //Updated Copyright slug - SWM.
  21. //
  22. //Revision 1.2  92/03/09  19:03:27  james
  23. //Added #CHKSUB directive to insure source
  24. //only compiled with correct revision of 
  25. //compiler.
  26. //
  27. //Revision 1.1  91/10/23  10:21:41  elsa
  28. //Initial revision
  29. //
  30. //************************************************************************/
  31.  
  32. //************************************************************************
  33. //     File Name: MonArray.Pkg
  34. // Creation Date: January 1, 1991
  35. // Modified Date: May 23, 1991
  36. //     Author(s): Steven A. Lowe
  37. //
  38. // This module contains the Monitored_Array class definition.
  39. //
  40. // This class may be used as a debugging tool to inspect arrays as they
  41. // are modified.
  42. //************************************************************************/
  43.  
  44. #CHKSUB 1 1 // Verify the UI subsystem.
  45.  
  46. use ui
  47.  
  48.  
  49. class monitored_array is an array
  50.   procedure construct_object 
  51.     forward send construct_object
  52.     property integer xloc public 0
  53.     property integer yloc public 15
  54.   end_procedure
  55.   procedure set array_value integer item# string val
  56.     forward set array_value item item# to val
  57.     send show_elements
  58.   end_procedure
  59.   procedure show_elements
  60.     local integer count maxx x y
  61.     local string val
  62.     get xloc to x
  63.     get yloc to y
  64.     calc (item_count(current_object) - 1) to maxx
  65.     clearxy y x
  66.     showln "ItemCount = " (maxx + 1)
  67.     for count from 0 to maxx
  68.       gotoxy (y + count + 1) x
  69.       get array_value item count to val
  70.       show "[" count "] = " val
  71.     loop
  72.   end_procedure
  73.   procedure SET item_count integer newVal
  74.     forward set item_count to newVal
  75.     send show_elements
  76.   end_procedure
  77.   procedure delete_item integer item#
  78.     forward send delete_item item#
  79.     send show_elements
  80.   end_procedure
  81. end_class
  82.  
  83.