Autor Beitrag
klemme
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 37



BeitragVerfasst: So 03.12.06 13:16 
Hi ich habe folgendes Problem das ich nich verstehe:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
procedure TForm1.Server1Execute(AThread: TIdPeerThread);
 var SEin: string;
begin
 with athread.connection do begin
 sein := readln;
 if SEin <> '' then    begin
 if SEin = '$55"Ende*#22' then
 Application.terminate; // AN DIESER STELLE MACHT ER NICHTS!!!
 else
 if SEin = '$55"Test*#22' then begin
 if checkbox1.Checked = false then begin
 writeln('$55"Bestätigt*#22');

 end;
 end else begin
 listbox1.lines.Add(SEin);
 if application.Active = FALSE then
  mmsystem.PlaySound('Tada',1,1);
 tt.ShowMainForm;
 form1.BringToFront;
 application.BringToFront;
 end;
 sein := '';
 end;
 end;
end;


An die Stelle wo Application.terminate steht, kommt er zwar wenn die bedingung erfüllt ist, er schließt die Anwendung aber nicht.
Vielleicht kann mir ja jemand weiterhelfen

_________________
ich werde das Unternehmen übernehmen
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 11.01.07 15:12 
Moin!

user profile iconklemme hat folgendes geschrieben:
An die Stelle wo Application.terminate steht, kommt er zwar wenn die bedingung erfüllt ist, er schließt die Anwendung aber nicht.

Mit Application.Terminate setzt du quasi nur ein Flag, dass in der nächsten Nachrichtenbearbeitung erst verarbeitet wird.

Probier das mal so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
//...
 if SEin = '$55"Ende*#22' then begin
 Application.terminate; // AN DIESER STELLE MACHT ER NICHTS!!!
 Exit; // Prozedur abbrechen
 end
 else
//...

Abgesehen davon: schonmal was von "Einrückung" gehört? :?

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.