مصطفی ساتکی
جمعه 12 اسفند 1390, 13:40 عصر
type
TIntList = TList<Integer>;
TIntList2 = TList<TIntList>;
var a : TIntList;
a2 ,a3 : TIntList2;
I: Integer;
j: Integer;
begin
a := TIntList.Create;
a.Add(10);
a.Add(20);
a.Add(30);
for I := 0 to a.Count - 1 do
ShowMessage(IntToStr(a[i]));
a2 := TIntList2.Create;
a2.Count := 3;
for i := 0 to a2.Count - 1 do
begin
a2[i] := TIntList.Create;
a2[i].Count := 3;
end;
for i := 0 to a2.Count - 1 do
for j := 0 to a2[i].Count - 1 do
a2[i][j] := ( (i+1) * 1000 + (j+1)* 100);
a3 := TIntList2.Create;
a3.AddRange(a2);
for i := 0 to a3.Count - 1 do
for j := 0 to a3[i].Count - 1 do
ShowMessage(IntToStr(a3[i][j]));
end;
TIntList = TList<Integer>;
TIntList2 = TList<TIntList>;
var a : TIntList;
a2 ,a3 : TIntList2;
I: Integer;
j: Integer;
begin
a := TIntList.Create;
a.Add(10);
a.Add(20);
a.Add(30);
for I := 0 to a.Count - 1 do
ShowMessage(IntToStr(a[i]));
a2 := TIntList2.Create;
a2.Count := 3;
for i := 0 to a2.Count - 1 do
begin
a2[i] := TIntList.Create;
a2[i].Count := 3;
end;
for i := 0 to a2.Count - 1 do
for j := 0 to a2[i].Count - 1 do
a2[i][j] := ( (i+1) * 1000 + (j+1)* 100);
a3 := TIntList2.Create;
a3.AddRange(a2);
for i := 0 to a3.Count - 1 do
for j := 0 to a3[i].Count - 1 do
ShowMessage(IntToStr(a3[i][j]));
end;