1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
var
tab1, tab2, tab3 : array of integer;
begin
setLength(tab1, list.count);
setLength(tab2, list.count);
setLength(tab3, list.count);
for i := 0 to list.count - 1 do
begin
tab1[i] := 0;
tab2[i] := 0;
tab3[i] := 0;
end;
for i := 0 to list2.count - 1 do
begin
//list2 contient des objets référencé dans list
Id := list2[i]^.ObjetContenuDansList^.id;
inc(tab1[Id]);
case n of
-1 : inc(tab2[Id]);
0 : inc(tab3[Id]);
end;
end;
//Les setLength se déroulent correctement
setLength(tab1,0);
setLength(tab3,0);
//sauf....
setLength(tab2,0);
//Pourquoi ???
end; |
Partager