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



BeitragVerfasst: Sa 27.12.03 18:08 
Also is sicher ne Noobfrage aber wie kann ich eine Variable die ich
Z.B. in der ersten Form bestimmt hab nachher in der zweiten Form nutzen?
Danke
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 27.12.03 18:10 
Hallo!

Bitte die Suchfunktion nutzen. Hätte z.B. das hier zu Tage gefördert:
www.delphi-forum.de/...variable+andere+form

MfG
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
smokydog Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Sa 27.12.03 18:12 
lol ich hatte andere such querys benutzt und nix gefunden danke
hmpf.


Zuletzt bearbeitet von smokydog am Sa 27.12.03 18:17, insgesamt 2-mal bearbeitet
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 27.12.03 18:14 
Kein Problem! :)

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
smokydog Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Sa 27.12.03 18:18 
Nope habe geschaut mein Prob is was anders.
In Form1 hat der eine verbindung zu form2 und 3. und die Formen 2und 3 sollen eine var von form1 bekommen, aber wenn ich unit1 in die uses schreibe hat der querverbindungen. ???
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Sa 27.12.03 18:26 
Moment, da muss ich mir jetzt erstmal ein Diagramm aufzeichnen. *kritzel*

Ah, Du hast eine Kreisbeziehung (nein, keine Dreiecksbeziehung ... oder?). Das wäre in etwas so, als würde ich folgendes definieren:
(1) Typ1 ist ein Array von Typ2
(2) Typ2 ist ein Array von Typ1

Kann nicht gehen. Um das zu umgehen, musst Du zusehen, welche Units Du im interface-Teil und welche im implementation-Teil einer anderen Unit brauchst. Oft reicht es aus, andere Units im implementation-Teil einzubinden. Sieht dann so aus (wenn tMyType in Unit2 definiert ist):
Unit1:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
   // myVar2 : TmyType; <-- klappt hier nicht, da "uses" weiter unten
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses unit2; //<-- hier erst!


procedure TForm1.FormCreate(Sender: TObject);
VAR myVar : tMyType; //<-- hier geht's
begin
  myVar.a := 'Hallo';
end;

end.


MfG
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
smokydog Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Sa 27.12.03 18:45 
danke funktionier :)
weisste noch wie ich eine EXTENDED Var in durch 1000 Teilen kann und dann als Integer ausgeben kann ?
DeCodeGuru
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1333
Erhaltene Danke: 1

Arch Linux
Eclipse
BeitragVerfasst: Sa 27.12.03 18:51 
Hi,

mach bitte für jede neue Frage ein neues Topic auf, sonst finden andere Benutzer des Forums ggf. eine Antwort o.ä. nicht. :)

Such aber mal im Forum nach Round, Trunc etc. Wir hatten letztens erst eine Diskussion darüber.

_________________
Viele Grüße
Jakob