Autor Beitrag
Tor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23


D5 Ent
BeitragVerfasst: Do 07.10.04 12:45 
Hi

Ich weis das es grundsetzlich möglich ist ein Exception zu um gehen oder dem Programm zusagen was es bei einem Exception machen soll. Was ich allerdings nicht weis wei ich den Code gestalten muß das der Exception ignoriert wird. Kann mir da jemand weiter helfen?
Softchaos67
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 103

XP Prof
Delphi 7
BeitragVerfasst: Do 07.10.04 13:10 
mach doch alles in einer Try...except anweisung ohne die exception zu behandeln.
Wenn dir dein Proggi dann nicht um dir Ohren fliegt...
Gruss
Matthias
Tor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23


D5 Ent
BeitragVerfasst: Do 07.10.04 13:51 
Das ist ja grad mein Problem ich weis nicht was ich das alles Reinschreiben soll
Softchaos67
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 103

XP Prof
Delphi 7
BeitragVerfasst: Do 07.10.04 13:57 
also ich bin nicht sicher ob ich dich verstehe.
Mal ein Beispiel
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure machwas;
var
   i :integer;
begin
   try
      i := IntToStr(edit1.text);   //wenn edit1.text keine ganzzahl ist wird eine exception ausgelöst!
   except
       // hier kannst du jetzt was machen oder nicht
      ShowMessage('i ist keine Zahl!');
   end;
end;


Hilft das weiter?
das geht auch mit try ...finally
Dabei wird der Code im Finally abschnitt auf jeden fall ausgeführt.
Gruss
Matthias
Tor Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23


D5 Ent
BeitragVerfasst: Do 07.10.04 14:13 
BIG THX das geht und mein Prog lebt noch goil
Softchaos67
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 103

XP Prof
Delphi 7
BeitragVerfasst: Do 07.10.04 14:14 
Freut mich wenn ich helfen konnte :D