Remplacer un Int dans un For par un array of int : Possible ?
Bonjour
Je me trouve à devoir imbriquer 12 boucles For et au final effectuer des opérations sur les items de 12 Tstringlist dont l index est la valeur de chacune de ces boucles...
Exemple limité à 3...
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| for c1 := 0 to List[1].Count - 1 do
begin
for c2 := 0 to List[2].Count - 1 do
begin
for c3 := 0 to List[3].Count - 1 do
begin
inc(itemp);
Grid.Cells[1, itemp] := List_Ligne[1][c1];
procedure( List[1][c1]);
Grid.Cells[2, itemp] := List_Ligne[2][c2];
procedure(List[2][c2]);
Grid.Cells[3, itemp] := List_Ligne[3][c3];
procedure( List[3][c3]);
end;
end;
end; |
mon idee etait donc de modifier cela avec une boucle comme suit :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
var c:array [1..12] of integer;
...
for c[1] := 0 to List[1].Count - 1 do
begin
for c[2] := 0 to List[2].Count - 1 do
begin
for c[3] := 0 to List[3].Count - 1 do
begin
for i:=1 to 3 do
begin
Grid.Cells[i, itemp] := List_Ligne[i]c[i];
procedure( List[i][c1]);
end;
end;
end;
end; |
mais j ai un beau message d erreur m indiquant que c est un integer et non un array of integer que je dois utiliser dans les boucles...
donc ma question : y a t il un moyen de contourner cela ?
merci de vos conseils
stephane