home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / GENERIC.ZIP / MAXARRAY.ZIP / H_ARRAYS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-07-23  |  1.2 KB  |  50 lines

  1. Unit H_Arrays;
  2. {$R-,S-,O+,V-}
  3.  
  4. { This unit demonstrates how to define MaxArrays for actual use   }
  5. { within your application.  Re-Defining the indicated methods     }
  6. { puts type-checking back, and makes the use of MaxArrays simpler }
  7.  
  8. { NOTE: If you wish to index from 1 to MaxElements (or otherwise), }
  9. {       you can simply adjust the value of Index in ACCEPT and     }
  10. {       RETRIEVE as appropriate.                                   }
  11.  
  12. INTERFACE
  13. Uses HugeAray;
  14.  
  15. Type
  16.   HugeIntegerArray = Object (MaxArray) {Indexed from 0..MaxElements-1}
  17.  
  18.     Procedure Init (MaxElements : LongInt);
  19.  
  20.     Procedure Accept (I : Integer; Index : LongInt);
  21.  
  22.     Function Retrieve (Index : LongInt) : Integer;
  23.  
  24.   End;
  25.  
  26. IMPLEMENTATION
  27.  
  28. Procedure HugeIntegerArray.Init;
  29. Begin
  30.   MaxArray.Init (MaxElements,SizeOf(Integer))
  31. End;
  32.  
  33. Procedure HugeIntegerArray.Accept (I : Integer; Index : LongInt);
  34. Var
  35.   J : Integer;
  36. Begin
  37.   J := I;
  38.   MaxArray.Accept (J,Index,SizeOf(Integer))
  39. End;
  40.  
  41. Function HugeIntegerArray.Retrieve (Index : LongInt) : Integer;
  42. Var
  43.   J : Integer;
  44. Begin
  45.   MaxArray.Retrieve (J,Index,SizeOf(Integer));
  46.   Retrieve := J
  47. End;
  48.  
  49. BEGIN
  50. END.