Autor Beitrag
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mi 07.06.06 13:40 
Hi,
ich habe die schon die Suche benutzt aber nichts gefunden.
Also ich fange eine Exception ab. Das funktioniert auch aber das Programm läuft einfach weiter. Gibt es da irgendeine möglichkeit die Procedure zu stoppen???
Ich wäre auch für andere Vorschläge offen.

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Beiri22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Mi 07.06.06 13:49 
Einfach ne Prozedur anhalten müsste doch mit exit gehen,

stell doch mal den Source her, da kann man das immer viel besser erkennen und zeigen.
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Mi 07.06.06 13:53 
Der Source:
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:
procedure TForm1.Button1Click(Sender: TObject);
var frmHilfe: Tform2;
begin
if Edit1.Text = Edit2.Text then ShowMessage ('Ihr müsst zwei unterschiedliche Namen verwenden!')// hier wird die "Exception" abgefangen aber das andere Fenster wird immer noch angezeigt 
 else
 if A = 1 then
  if (Edit1.Text = '') or (Edit2.Text = '') then
  begin
   Form1.Edit1.Text := '"X"';
   Form1.Edit2.Text := '"O"';
   self.hide ;
   frmHilfe := TForm2.Create(nil);
   frmHilfe.ShowModal();
   frmHilfe.close;
   frmhilfe.free;
   self.show;
  end
  else
   self.hide ;
   frmHilfe := TForm2.Create(nil);
   frmHilfe.ShowModal();
   frmHilfe.close;
   frmhilfe.free;
   self.show;
end;


PS: Exception triffts nicht ganz

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Beiri22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Mi 07.06.06 21:25 
was ist A?

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:
27:
28:
procedure TForm1.Button1Click(Sender: TObject); 
var frmHilfe: Tform2; 
begin 
if Edit1.Text = Edit2.Text then ShowMessage ('Ihr müsst zwei unterschiedliche Namen verwenden!') 
else begin //den ganzen letzten Teil in den else-part mit rein
 if A = 1 then 
  if (Edit1.Text = '') or (Edit2.Text = '') then 
  begin 
   Form1.Edit1.Text := '"X"'; 
   Form1.Edit2.Text := '"O"'; 
   self.hide ; 
   frmHilfe := TForm2.Create(nil); 
   frmHilfe.ShowModal(); 
   frmHilfe.close; 
   frmhilfe.free; 
   self.show; 
  end 
  else 
  //sollte hier nicht noch ein begin rein??
   self.hide ; 
   frmHilfe := TForm2.Create(nil); 
   frmHilfe.ShowModal(); 
   frmHilfe.close; 
   frmhilfe.free; 
   self.show; 
  //sollte hier nicht noch ein end rein??
end;
end;
Leuchtturm Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Fr 09.06.06 16:20 
Danke es funktioniert

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
Beiri22
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 42



BeitragVerfasst: Sa 10.06.06 08:21 
Ich muss sagen, dass es mich freut, auch mal jemandem in diesem Forum geholfen zu haben und nicht nur immer selbst hilfe zu bekommenn.