Hallo an alle!
Ich bin heute schonmal mit einem Problem aus diesem Programm gekommen. Ich habe schon seit einiger Zeit das Gefühl, dass die Try-Except-Anweisungen nicht so richtig funktionieren bei mir, oder ich wende sie falsch an. Vielleicht könnt ihr mir weiterhelfen.
Hier mein Code:
Delphi-Quellcode:
If ((GetAsyncKeyState(VK_NUMPAD0)) <> 0) Then
begin
Try
bombesp1[laufzahl_bombe1] := TImage.Create(Form1);
with bombesp1[laufzahl_bombe1] do
begin
Visible := true;
Top := 64;
Left := 200;
Width := 49;
Height:= 65;
Stretch := True;
Proportional := True;
Name := 'Bombe' + IntToStr(laufzahl_bombe1) + '_SP1';
Parent := Form1;
Picture.Bitmap.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'bombe.bmp');
end;
Except
bombesp1[laufzahl_bombe1].Left := Image1.Left;
bombesp1[laufzahl_bombe1].Top := Image1.Top;
bombesp1[laufzahl_bombe1].Visible := True;
Delay(2000);
bombesp1[laufzahl_bombe1].Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'bombe_explodiert.bmp');
end;
end;
Wäre für jede Hilfe dankbar.
Simme