home *** CD-ROM | disk | FTP | other *** search
- Program TestList; {Test Program for Descendants of Generic Lists}
-
- Uses Lists;
-
- Var
- A,B : IntList;
- I : Integer;
-
- Begin
-
- A.Create;
- A.Init;
-
-
- For I := 1 to 10 do
- A.Append(I);
-
- I := 9999;
- A.InsertAfter_N (I,8);
- I := 6666;
- A.ReSetElement_N (I,3);
- A.Delete (6);
- WriteLn ('After Delete(6), Current Element is number ',A.Current);
- For I := 1 to A.CurrentLength do
- WriteLn ('A List Element ',I,' is ',A.GetElement_N(I):4);
- A.ReWind;
- WriteLn ('After ReWinding Current Element is number ',A.CurElem);
- Write ('Current Length is ',A.CurrentLength);
- ReadLn;
-
- B.Create;
- B.Copy (A);
-
- For I := 1 to B.CurrentLength do
- WriteLn ('B List Element ',I,' is ',B.GetElement_N(I):4);
-
- WriteLn;
-
- For I := 1 to A.CurrentLength do
- WriteLn ('A List Element ',I,' is ',A.GetElement_N(I):4);
-
- A.Destroy;
- B.Destroy;
-
- ReadLn;
- End.
-