Autor Beitrag
FloL
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
Delphi 2005
BeitragVerfasst: Do 24.08.06 13:20 
Hi, bring mir gerade Delphi selber bei, was mich auch schon einiges an nerven diese wochen gekostet hat. Hab jetzt aber mal ne Frage, da ich dazu leider nix finden konnte.
Und zwar würde ich gerne, in einer procedure eine andere procedure aufrufen. Kann man das und was müsst ich da eingeben, ich hab schon nen bisschen herum probiert, aber es wollte nicht laufen...
Wäre nett, wenn mir das einer sagen könnte.

Gruß

Florian
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 24.08.06 13:26 
Einfach
ausblenden Delphi-Quelltext
1:
<Prozedurname>( <Paramterliste>);					


Aber richtig verstehe ich deine Frage nicht.

_________________
Markus Kinzler.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 24.08.06 13:35 
Meinst du sowas?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure SagHallo;
begin
  showmessage('Hallo');
end;

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

_________________
We are, we were and will not be.
FloL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
Delphi 2005
BeitragVerfasst: Do 24.08.06 13:35 
Naja ich möchte in einer procedure, keine ahnung, ich klick nen button, und man kann dort das ausführen, was in der procedure des buttons steht und ausserdem das, was in einer anderen procedure steht. Oh das über sieht schon ganz gut aus...Gleich mal ausprobieren.
FloL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
Delphi 2005
BeitragVerfasst: Do 24.08.06 13:51 
hmm.. hab das mal so in der art gemacht, aber irgendwie gibt er mir dann den fehler
ausblenden Quelltext
1:
[Fehler] optionplaner.pas(39): E2003 Undefinierter Bezeichner: 'cbstadt'					

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure stadt;
begin
if cbstadt.itemindex = 0 then
  begin
   fplaner.GroupBox1.visible:=true;


Muss ich da noch was eintragen? irgendwie public oder so machen?

Moderiert von user profile iconGausi: Code- und Delphi-Tags hinzugefügt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 24.08.06 14:00 
"stadt" scheint eine Prozedur für sich zu sein, keine Prozedur einer Form. Als solche kennt diese Prozedur natürlich nicht die ganzen Eigenschaften von Form1, daher muss man dann das "Form1." immer dazu schreiben, wie du es bei der Groupbox auch richtig gemacht hast.

Besser wäre aber wahrscheinlich in diesem Fall, wenn du die Prozedur "stadt" selbst zu einer Prozedur der Form machst. Dazu einfach in die Prozedurenliste am Anfang den Namen dazuschreiben, und weiter unten bei der Implementierung ein "TForm1." vor den Prozedur-Namen schreiben.

_________________
We are, we were and will not be.
FloL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
Delphi 2005
BeitragVerfasst: Do 24.08.06 14:16 
ich hätte da dann noch ne frage...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure stadt;
begin
if foptionplaner.cbstadt.itemindex = 0 then
  begin
   fplaner.GroupBox1.visible:=true;  //die gehen zu ner anderen form
   fplaner.GroupBox2.visible:=false; // ""
   fplaner.GroupBox3.visible:=false; // ""
   fplaner.GroupBox4.visible:=false; // ""


das funktioniert schonmal, und wenn ich das jetzt form übergreifend machen will?
hab da schon mal was ausprobiert gehabt, aber ging leider nicht
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 24.08.06 14:18 
Zitat:
das funktioniert schonmal, und wenn ich das jetzt form übergreifend machen will?
Genauso. Form muß halt bekannt sein (Uses)

_________________
Markus Kinzler.
freak4fun
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 604
Erhaltene Danke: 4

Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
BeitragVerfasst: Do 24.08.06 14:20 
Dann schreibst da einfach noch den Unitnamen vor. Und die Unit natürlich in die Uses-Liste eintragen. ;)

MfG
freak

_________________
"Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
FloL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
Delphi 2005
BeitragVerfasst: Do 24.08.06 14:42 
Hab ich gemacht, geht leider nicht

ausblenden Delphi-Quelltext
1:
uses alarm2, optionplaner,					


ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TFplaner.FormCreate(Sender: TObject);
begin
foptionplaner.stadt;
end;


[Fehler] optionplaner.pas(37): E2004 Bezeichner redefiniert: 'foptionplaner'

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure foptionplaner.stadt;
begin
if foptionplaner.cbstadt.itemindex = 0 then
  begin
   fplaner.GroupBox1.visible:=true;
   fplaner.GroupBox2.visible:=false;
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 24.08.06 14:45 
Es scheint hier auch das Problem des Über-Kreuz-Zugriffs zu geben. Binde die eine im Interface und die andere im Implemnation-Abschnitt ein.

_________________
Markus Kinzler.
FloL Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29

Win XP
Delphi 2005
BeitragVerfasst: Do 24.08.06 14:51 
Ich habe keine ahnung was du meinst, jedenfalls, lass ich die form. davor weg, dann funktioniert es.
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Sa 26.08.06 00:41 
Schreib die Units mal nicht oben hin sondern unters implementation
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
...

implementation

uses
  alarm2, optionplaner;

...


Schick auch nochmal deinen kompletten Quelltext so das man eine bessere Übersicht hat.