Autor Beitrag
AlA
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Do 03.04.03 11:20 
Hallo,
Ich möchte eine Objektanweisung

r21.visible:=false;r22.visible:=false;r23.visible:=false;r24.visible:=false;r25.visible:=false;

mehrmalse an verschiedenen Stellen ausführen lassen.
Ich habe versucht es als eine Procedur zu definieren
und dann aufzurufen-ging aber nicht!!!
Hat jemand eine Idee wie ich das bewerkstelligen kann???

_________________
ala
maximus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 896

Win XP, Suse 8.1
Delphi 4/7/8 alles prof
BeitragVerfasst: Do 03.04.03 11:24 
Wichtig ist, dass du die prozedur als methode der form-klasse, in der du dich befindest, definierst. Will heissen, du must die procedur in dem object deklarieren.

_________________
mfg.
mâximôv
AlA Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Do 03.04.03 11:36 
Titel: Gute Idee
Leider bezieht sich meine Anweisung auf verschiedene
Objekte.Ich wollte es auf diese Art abkürzen.

_________________
ala
teebee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 109


D6 Prof
BeitragVerfasst: Do 03.04.03 11:46 
Wie bzw. wo hast Du Die Prozedur definiert? Wie rufst Du sie auf? Poste am besten mal etwas Code.

mfg, teebee
teebee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 109


D6 Prof
BeitragVerfasst: Do 03.04.03 11:49 
ach nochwas: von welchem Typ sind r21 etc.?

mfg, teebee
AlA Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Do 03.04.03 11:49 
Ich habe leider keine Prozedur definieren können,
da ich die Fehlermeldung "Undefinierter Bezeichner" bekomme.
Ich stelle es mir aber so vor:

ausblenden Quelltext
1:
2:
3:
4:
PROCEDURE Allesunsichtbar;
begin
r11.visible:=false;r12.visible:=false;r13.visible:=false;
end;


und dann mit Allesunsichtbar aufrufen!

Moderiert von user profile iconUGrohne: Code-Tags hinzugefügt

_________________
ala
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 03.04.03 12:08 
Wie maximus schon schrieb, musst Du die Prozedur in der Form-Klasse deklarieren. Also so:

ausblenden Quelltext
1:
2:
Procedure TForm1.Allesunsichtbar;
...


Und dann noch im Objekt TForm1 im Interface-Teil deklarieren.


Alternativ, kannst Du es auch so machen:
ausblenden Quelltext
1:
2:
3:
4:
PROCEDURE Allesunsichtbar;
begin
form1.r11.visible:=false;form1.r12.visible:=false;form1.r13.visible:=false;
end;


MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".