Procédure : paramètre TShape.
Bonjour à tous,
Me voila bloqué à nouveau... :calim2:
J'ai une procédure avec plusieurs paramètres! un des paramètres est un tableau de TShape car j’appellerai cette fonction une fois avec avec un tableau de TRectangle, et une autre fois avec des TCircle.
Mais il me met des erreurs d'accès!
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| procedure TForm4.minMaxTotalAmp(tab: array of real; tabLab: array of TLabel; str: string; arrayComposant: array of TShape);
var
t:integer;
min, max, h: real;
rmin, rmax: Tarray<integer>;
begin
........... //pas important!
for t := 0 to length(rmin)-1 do
begin
arrayComposant[rmin[t]].Stroke.Color:=TAlphaColorRec.Blue;
arrayComposant[rmin[t]].Stroke.Thickness:=2;
end;
for t := 0 to length(rmax)-1 do
begin
arrayComposant[rmax[t]].Stroke.Color:=TAlphaColorRec.Red;
arrayComposant[rmax[t]].Stroke.Thickness:=2;
end;
end; |
et j'appelle 2 fois ma fonction :
Code:
1 2 3 4 5
| arrayRectTotal: array[0..5] of TShape;
arrayCerAmp: array[0..6] of TShape;
minMaxTotalAmp(tabTot, arrayLabelTot, 'V', arrayRectTotal);
minMaxTotalAmp(tabAmp, arrayLabelAmpe, 'A', arrayCerAmp); |