Hallo zusammen...
Bei mir taucht immer diese dämliche Fehlermeldung auf, wenn ich in meinem Delphi-Programm etwas in den folgenden Array speichern will:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16:
| for Iy:=0 to BMlength do begin for Ix:=0 to BMlength do begin Bx:=(abs(Ix-BMhalf)); By:=(abs(Iy-BMhalf)); Bradius:=round(sqrt(sqr(Bx)+sqr(By))); if (Bradius<=BR) AND (Bradius>=IBR) then begin form1.Image8.Canvas.Pixels[Ix,Iy]:=clNavy; ax[I]:=Ix; ay[I]:=Iy; I:=I+1; end else begin form1.Image8.Canvas.Pixels[Ix,Iy]:=clRed; end; end; end; |
Variabeln sind so definiert:
Delphi-Quelltext
1: 2: 3: 4: 5: 6:
| var I, I1, I2, Ix, Iy, Bx, By, Bradius, BMhalf: integer;
und
ax, ay: array of integer; |
Wo liegt das Problem?
(Ich erspar euch den ganzen Programmcode, ist nämlich ziemlich lange... Die Fehlermeldung taucht wie gesagt direkt nach dem ersten mal speichern in den Array auf und in der Grafik ist dann dieser einzelne Navy-farbene Punkt sichtbar.
Danke für eure Hilfe
Edit: Genaue Fehlermeldung:
Project Project1.exe raised exception class EAccessViolation with message 'Access violation at address 004590CD in module 'Project1.exe'. Write of address 00000000'. Process stopped. Use Step or Run to continue.