Autor Beitrag
Lemon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 96

Win XP
D5 Standart
BeitragVerfasst: Mo 20.10.03 14:38 
hallo,

ich moechte prozedur x von prozedur y aus vorzeitig beenden.
ist das irgendwie moeglich??
vielen dank schon mal...

Lemon
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 20.10.03 14:54 
Nein, geht nicht, wie auch.

Wenn du Prozedur X "anstößt", dann läuft sie bis zum Ende durch, Prozedur Y, kann da gar nicht zum Zuge kommen.

Abderst sieht es aus, wenn in Prozedur X eine Schleife abgearbeitet wird, die kann ich natürlich unterbrechen und die Prozedur verlassen. Wie das geht wurde hier schon oft genug besprochen.
FriFra
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 557

Win XP Prof, Win XP Home,Win Server 2003,Win 98SE,Win 2000,Win NT4,Win 3.11,Suse Linux 7.3 Prof,Suse Linux 8.0 Prof
D2k5 Prof, D7 Prof, D5 Standard, D3 Prof, K3 Prof
BeitragVerfasst: Mo 20.10.03 14:56 
Du könntest z.B. eine globale "Abbruchvariable" deklarieren, welche Du in Procedur2 auf True setzt...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure procedure1;
begin
  ExitProc2 := True;
end;

procedure procedure2;
begin
  try

    ...

    { Diese Zeile dann ggf. mehrfach einbauen }
    if ExitProc2 = True then
      Exit; 

    ...

  finally
    ExitProc2 := False;
  end;
end;

_________________
Michael
(principal certified lotus professional - developer)
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mo 20.10.03 16:25 
Anzumerken ist, daß Proc1 durch Button-Click etc. nur dann Zur Laufzeit von Proc2 durchgeführt wird, wenn innerhalb der Proc2 Application.ProcessMessages aufgerufen wird.

Cu,
Udontknow