home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / arrays / generics / genlist / testlist.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1989-07-24  |  914 b   |  48 lines

  1. Program TestList; {Test Program for Descendants of Generic Lists}
  2.  
  3. Uses Lists;
  4.  
  5. Var
  6.   A,B : IntList;
  7.   I   : Integer;
  8.  
  9. Begin
  10.  
  11.   A.Create;
  12.   A.Init;
  13.  
  14.  
  15.   For I := 1 to 10 do
  16.     A.Append(I);
  17.  
  18.   I := 9999;
  19.   A.InsertAfter_N (I,8);
  20.   I := 6666;
  21.   A.ReSetElement_N (I,3);
  22.   A.Delete (6);
  23.   WriteLn ('After Delete(6), Current Element is number ',A.Current);
  24.   For I := 1 to A.CurrentLength do
  25.     WriteLn ('A List Element ',I,' is ',A.GetElement_N(I):4);
  26.   A.ReWind;
  27.   WriteLn ('After ReWinding Current Element is number ',A.CurElem);
  28.   Write ('Current Length is ',A.CurrentLength);
  29.   ReadLn;
  30.  
  31.   B.Create;
  32.   B.Copy (A);
  33.  
  34.   For I := 1 to B.CurrentLength do
  35.     WriteLn ('B List Element ',I,' is ',B.GetElement_N(I):4);
  36.  
  37.   WriteLn;
  38.  
  39.   For I := 1 to A.CurrentLength do
  40.     WriteLn ('A List Element ',I,' is ',A.GetElement_N(I):4);
  41.  
  42.   A.Destroy;
  43.   B.Destroy;
  44.  
  45.   ReadLn;
  46. End.
  47.  
  48.