Autor Beitrag
Anarkids
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 81

Win XP Pro, Freundin
Delphi 2006, C/C++, VisualBasic
BeitragVerfasst: Fr 17.03.06 10:43 
hi leute.

ich hätt da mal ne etwas doofe frage: kann ich einen sprung aus einer prozedur in die andere erzwingen?

mfg, anarkids


Moderiert von user profile iconGausi: Topic aus Sonstiges (Delphi) verschoben am Fr 17.03.2006 um 09:45
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 17.03.06 10:47 
Klar geht das:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure eins;
begin
  showmessage('Eins');
end;

procedure zwei;
begin
  eins;
  showmessage('Zwei');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  zwei;
end;

_________________
We are, we were and will not be.
Anarkids Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 81

Win XP Pro, Freundin
Delphi 2006, C/C++, VisualBasic
BeitragVerfasst: Fr 17.03.06 10:52 
erstmal danke dir!

kann ich auch an bestimmte stellen springen? oder muss ich die procedure immer neu aufrufen, wenn ich springen will?

und was ist wenn ich z.b. sowas mache:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure eins;
begin
  showmessage('Eins');
end;

procedure zwei;
begin
  TForm1.Button1Click; //Hier will ich in die Button Click procedure springen...
  showmessage('Zwei');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  zwei;
end;


danke im vorraus!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 17.03.06 10:57 
Hab ich eben noch vergessen: :welcome: in der Entwickler-Ecke!

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure zwei;   
begin   
  TForm1.Button1Click(NIL)//Hier will ich in die Button Click procedure springen...   
  showmessage('Zwei');   
end;   

procedure TForm1.Button1Click(Sender: TObject);   
begin   
  zwei;   
end;

Das kann man machen. Dir sollte aber klar sein, dass das ne Endlosschleife gibt ;-)

An eine bestimmte Zeile in einer Prozedur springen geht nicht. Eine Prozedur kann nur als ganzes aufgerufen werden.
Aber man kann über Parameter steuern, was die Prozedur machen soll:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure einzwei(zahl: integer);
begin
  if zahl=1 then eins
  else
   if zahl=2 then zwei;
end;

_________________
We are, we were and will not be.
Anarkids Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 81

Win XP Pro, Freundin
Delphi 2006, C/C++, VisualBasic
BeitragVerfasst: Fr 17.03.06 11:06 
klar danke. hab ein riesen problem mit meinem quelltext ;-) hoffe ich kann das so lösen


mfg...