Autor Beitrag
sklorzy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 10.04.04 13:13 
Hi,
ich hab da ein Problem: ich will eine Variable mit dem in ihr abgespeicherten Wert in eine andere Unit übertragenum mit ihr weiterzuarbeiten,allerdings weiß ich nicht genau wie das funktioniert. Kann mir jemand dafür den Quelltext geben??
Brainiac
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 10.04.04 19:55 
Das Problem ist glaube ich noch nicht ganz klar.

Wenn du die Unit, aus der die Variable stammt, in eine andere Unit einbindest, indem du sie in den Uses-Teil schreibst (am besten unter implementation), dann hast du auch Zugriff auf sie.
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 10.04.04 20:23 
ein code-bsp gefällig? :D

ausblenden Delphi-Quelltext
1:
2:
3:
4:
//Unit1:
var
  Form1: TForm1;
  lab: integer; // oder im "public" - Bereich


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
//Unit2:
implemation
uses Unit1;
...
Unit1.lab:= 123456789;


so. :-P

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
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 10.04.04 20:45 
Die Unit

ausblenden Delphi-Quelltext
1:
Unit1.lab:= 123456789;					


braucht man nicht davorstellen. Es sollte auch ohne gehen

ausblenden Delphi-Quelltext
1:
lab:= 123456789;					

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(
sklorzy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 10.04.04 21:57 
Titel: Danke
Danke für die Hilfe!
Das war genau das was ich meinte!!