home *** CD-ROM | disk | FTP | other *** search
- Unit H_Arrays;
- {$R-,S-,O+,V-}
-
- { This unit demonstrates how to define MaxArrays for actual use }
- { within your application. Re-Defining the indicated methods }
- { puts type-checking back, and makes the use of MaxArrays simpler }
-
- { NOTE: If you wish to index from 1 to MaxElements (or otherwise), }
- { you can simply adjust the value of Index in ACCEPT and }
- { RETRIEVE as appropriate. }
-
- INTERFACE
- Uses HugeAray;
-
- Type
- HugeIntegerArray = Object (MaxArray) {Indexed from 0..MaxElements-1}
-
- Procedure Init (MaxElements : LongInt);
-
- Procedure Accept (I : Integer; Index : LongInt);
-
- Function Retrieve (Index : LongInt) : Integer;
-
- End;
-
- IMPLEMENTATION
-
- Procedure HugeIntegerArray.Init;
- Begin
- MaxArray.Init (MaxElements,SizeOf(Integer))
- End;
-
- Procedure HugeIntegerArray.Accept (I : Integer; Index : LongInt);
- Var
- J : Integer;
- Begin
- J := I;
- MaxArray.Accept (J,Index,SizeOf(Integer))
- End;
-
- Function HugeIntegerArray.Retrieve (Index : LongInt) : Integer;
- Var
- J : Integer;
- Begin
- MaxArray.Retrieve (J,Index,SizeOf(Integer));
- Retrieve := J
- End;
-
- BEGIN
- END.