Autor Beitrag
sam3st
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

Win XP
D7 Enterprise
BeitragVerfasst: Fr 24.11.06 22:37 
hallo ich habe ein programm welches forms zur laufzeit erstellt und denen unterschiedliche namen gibt.

kann ich bei dieser form2 im ondestroy ereignis nicht eine variable von form1 verändern? gibt es da irgendeine möglichkeit?
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 24.11.06 22:38 
Jap. Deklariere die Variable in Form 1 global -> Suche in der Entwickler-Ecke VARIABLE GLOBAL -> www.delphi-forum.de/...ght=variable++global

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
sam3st Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

Win XP
D7 Enterprise
BeitragVerfasst: Fr 24.11.06 22:40 
habe ich bereits getan, ich kann jedoch von form2 auf keine variable aus form1 zugreifen, form1. bzw tform1. geht nicht!

nur die variable ebenfalls nicht... bin noch nicht ganz so drin in der delphi materie deshalb denke ich dass das kein allzu grosses problem sein dürfte
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 24.11.06 22:43 
Dann tu es bei public rein:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
    MyVar: Integer;
  end;

Und in der 2. Unit uses Form1 nicht vegessen.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
sam3st Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

Win XP
D7 Enterprise
BeitragVerfasst: Fr 24.11.06 22:56 
also ich denke mal du meinst ich soll in unit 1 bei uses nich form1 sondern unit1 eintragen... doch das geht nicht, da unit2 bereits von unit1 benutzt wird (um das form während der laufzeit zu erzeugen)
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Fr 24.11.06 22:58 
Du mussts unter implementation eintragen.
Es geht immer nur 1x uses und 1x implementation ;)
d.h.
ausblenden Delphi-Quelltext
1:
2:
implementation
 uses unit2


Zuletzt bearbeitet von Marc. am Fr 24.11.06 22:59, insgesamt 1-mal bearbeitet
sam3st Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 55

Win XP
D7 Enterprise
BeitragVerfasst: Fr 24.11.06 22:59 
Juchhee danke.. so gehts!