Autor Beitrag
Ochsenfrosch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 75

Win 2000 Prof.
Delphi 7
BeitragVerfasst: Fr 23.04.04 22:09 
hi

Wenn ich 2 Formen habe und von der einen form (BSP: form1) auf die variablen von form 2 zugreifen will. was muss ich schreiben?
form2.[name der variable] geht nicht...

_________________
Immer positiv denken!!!! (Windows kackt nicht ab, Windows kackt nicht ab....)
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Fr 23.04.04 22:49 
das geht schon, allerdings sollte dann in form1 bei den uses unit2 hinzugefügt werden und die Variable in Form2 Global deklariert sein
Ochsenfrosch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 75

Win 2000 Prof.
Delphi 7
BeitragVerfasst: Sa 24.04.04 15:07 
Titel: Was ist global?
wie deklariere ich das ding "global"?

_________________
Immer positiv denken!!!! (Windows kackt nicht ab, Windows kackt nicht ab....)
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 24.04.04 15:12 
Nicht global. Deklarier sie im public Abschnitt der Form-Klasse.
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Sa 24.04.04 15:42 
auch gut im sinne der OOP :lol:
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Sa 24.04.04 15:55 
Global wird die Variable wenn du sie im Interface Teil der Unit unter var deklarierst.

Luckie hat folgendes geschrieben:
Nicht global. Deklarier sie im public Abschnitt der Form-Klasse.


Wenn du schon sowas schreibst, d.h. eine Empfehlung gibst, dann sag dem Anfänger auch warum es deiner Meinung nach besser ist. Sonst glaub er in Zukunft, daß global in public Abschnitt der Form-Klasse bedeutet.

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(