Registriert seit: 13. Feb 2006
Ort: Bad Honnef
765 Beiträge
Turbo Delphi für Win32
|
Re: Zugriffsverletzung bei if in einer for-Schleife
16. Mai 2006, 21:00
Also so:
Delphi-Quellcode:
var I: Integer;
Image: Array[1..13] of TImage;
begin
for I := 0 to 12 do
if (FindComponent(Image[I+1]).Top = 96) and (FindComponent(Image[I+1])Left = 8) then FindComponent(Image[I+1]).Top := 48
else if (FindComponent(Image[I+1]).Top = 48) and (FindComponent(Image[I+1]).Left = 536) then FindComponent(Image[I+1]).Top := 96
else if (FindComponent(Image[I+1]).Top = 96) and (FindComponent(Image[I+1]).Left = 536) then FindComponent(Image[I+1]).Top := 144
else if (FindComponent(Image[I+1]).Top = 144) and (FindComponent(Image[I+1]).Left >= 9)then FindComponent(Image[I+1]).Left := FindComponent(Image[I+1]).Left - 8
else if (FindComponent(Image[I+1]).Top = 144) and (FindComponent(Image[I+1]).Left = 8) then FindComponent(Image[I+1]).Top := 96
else FindComponent(Image[I+1]).Left := FindComponent(Image[I+1]).Left + 8;
end;
oder wie?
Tomorrow will be cancelled due to lack of interest.
|