Autor Beitrag
Lena
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Di 19.04.05 18:29 
Hi,
ich hab ein kleines problem:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure gewinn(x:char; var y:integer);
begin
     if x=CRichtig[i] then y:=y+100;
     Panel3.caption:=inttostr(y);  // <--- 
end;


da sagt er es wäre ein undefinierter bezeichner, aber wenn ich es bei nem button reinschreibe funktioniert alles (also das panel existiert..). Wieso??? was kann ich machen damit das funzt?

Dankesehr - Lena

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8553
Erhaltene Danke: 479

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 19.04.05 18:31 
Gewinn scheint keine Prozedur der Form zu sein, auf der das Panel liegt. Daher muss man das so machen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure gewinn(x:char; var y:integer);
begin
     if x=CRichtig[i] then y:=y+100;
     Form1.Panel3.caption:=inttostr(y); 
end;

_________________
We are, we were and will not be.
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 19.04.05 18:36 
Wenn das das Problem ist, dann muss Form1 aber auch unter uses stehen... Oder macht er das dann automatisch? :gruebel: Werd's mal schnell ausprobieren. ;)
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8553
Erhaltene Danke: 479

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 19.04.05 18:38 
Form1 nicht unbedingt. Eher sowas wie Unit1. Und das auch nur dann, wenn man tatsächlich ne andere UNit für die Funktion nimmt, was ich anhand der Formulierung eher nicht annehme...

_________________
We are, we were and will not be.
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Di 19.04.05 18:39 
Er dürfte das nicht automatisch machen, da er erstaml wissen müsste wie die Unit-Pas heißt, da er ja nicht alle ausprobierem kann auf der Festplatte :wink: .
Lena Threadstarter
Hält's aus hier
Beiträge: 4



BeitragVerfasst: Di 19.04.05 18:41 
Vielen Dank, problem gelöst =)
(aber müsste es nicht auch funktionieren wenn man die erste zeile von der procedure in dieses form1-paket reinschreibt? leider macht er das nich...*g* naja, geht ja trotzdem)

Lena
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Di 19.04.05 18:41 
user profile iconGausi hat folgendes geschrieben:
Form1 nicht unbedingt. Eher sowas wie Unit1.

Ooooops. Was fürn Klopps. Natürlich die Unit.. :lol:

user profile iconHeiko hat folgendes geschrieben:
Er dürfte das nicht automatisch machen, da er erstaml wissen müsste wie die Unit-Pas heißt, da er ja nicht alle ausprobierem kann auf der Festplatte :wink: .

Nun ja. Aber anscheinend schaut er das Projekt durch und wenn's da dann sowas passendes gibt dann fragt er. ;)