Autor Beitrag
Trialtom
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Sa 16.11.02 20:20 
hallo,

1.
gibt es irgendeine globaldeklaration, dass ich die variablen werte die ich einem formular (z.b. form1) habe genauso in einem anderen formular (z.b. form2) nutzen kann?

2.
form1: form2.caption:='123';
form2.show;
form1.hide;

form2: oncreate: c:=form2.caption; {c=string}
label1.caption:=c[2];

--> in form1 habe ich form2.caption in '123' verändert und dann auch auf form2 verwiesen. jetzt wo form2.caption ja '123' sein sollte, müsste c dann auch '123' sein, und im label1 müsste '2' stehen. aber irgendwie nicht der wert c immer noch das an was vorher in form2 stand (Form2) und im label steht 'o', obwohl ich vorher schon form2.caption verändert habe. also meine frage: wie kann man das beheben, wenn ihr wisst was ich meine.

schonmal danke.
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Sa 16.11.02 22:43 
Zitat:
in form1 habe ich form2.caption in '123' verändert

Und in welchem Ereignis genau?
Etwa OnShow? Wenn dies der Fall sein sollte, dann schau dir mal folgenden Ablauf an.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Form1.OnCreate
Form2.OnCreate {
  c:=form2.caption;
  label1.caption:=c[2]; 
}
Form1.OnShow {
  Form2.caption:='123';
  Form2.OnShow
  Form1.OnHide
}

_________________
Ist Zeit wirklich Geld?