Autor Beitrag
Larus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Sa 17.04.04 12:50 
Bei meinen Spielen/Programmen entstehen immer Fehler, wenn der Client schneller aktiv ist als der Server und/oder keine verbindung aufgebaut werden kann! Ich glaub so geht es jedem, der den Fehler nicht abfängt und umgewandelt ausgibt oder gar nicht anzeigt! Ich wollte das mit dem, wenn er keine Verbindung kriegt in "Form1.Statusbar1.Panels[0].Text:='Verbindung kann nicht hergestellt werden'" angezeigt wird!
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: Sa 17.04.04 12:56 
ausblenden Delphi-Quelltext
1:
Try Except					

und
ausblenden Delphi-Quelltext
1:
Try Finally					

sind dein Freund und Helfer
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 17.04.04 13:00 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.ClientSocketError(Sender: TObject;
  Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
  var ErrorCode: Integer);
begin
     ErrorCode := 0;
end;
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: So 18.04.04 12:57 
Titel: Danke für die...
Danke nochmal für die Tipps und Codeausschnitte... :idea:
Leider kann ich noch nicht so gut mit try/except/finnaly umgehen (ich bekomme jedes mal fehler) :( Doch wenn du (Martin77) mir mal eine Erläuterung in eine Antwort schreiben könntest wäre das sehr Gut! Dank an "toms". 8) Nun schießt sich nicht mehr alles doppelt und dreifach beim testen der geschrieben Programme ab und auch hintereher nicht mehr!
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 18.04.04 13:01 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
try
  blablabla;
except
  blablabla;
end;
Martin77
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 282

XP Prof
D6 Prof, D7 Personal, D7 Enterprise, D8 personal
BeitragVerfasst: So 18.04.04 13:51 
den Except Block verwendest du um auf einen Fehler zu reagieren, wenn es etwas gibt was du unbedingt machen willst verwendest du stattdessen finally, der wird sowohl im Fehler als auch im Erfolgsfamm durchlaufen. Wie man beide kombinieren kann weiss ich nicht ,weiss auch ganricht obs geht, ich mache dann immer nen try finally um meinen try Except block.


Martin
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: So 18.04.04 15:16 
guck dir mal diesen FAQ-Eintrag hier an:
www.delphi-forum.de/viewtopic.php?t=22001
Larus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 431



BeitragVerfasst: Di 20.04.04 18:56 
Titel: Ende mit Danke
Vielen Dank fuer die Tips! Damit waere das Problem geklaert! :lol: