Autor Beitrag
Cookie007
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: Sa 07.01.06 23:09 
Hallo leute,

Ich versuche über unit2 eine Variable in Unit1 zu erreichen :!:

Ich könnte mir vorstellen, dass vor die Variable etwas kommen könnte wie
Unit1.tatwaffe :?!?:

oder ich muss Universale Variablen vereinbaren die für alle units zugänglich sind
bitte um Hilfe (bin noch Anfänger) :?!?:

danke
Cookie 007 :wink:

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Sa 07.01.06 23:20 
Hallo,

Falls unit1 in Unit2 eingebunden ist(uses unit1 aber nach implementation) geht das mit
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
unit2 ...
uses
  ??,???,???
type 
  ????

implementation

uses 
  unit1;
function Loetzinn:integer;
begin
  result := unit1.intVariable;
end;


Gruss Horst
Cookie007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: Sa 07.01.06 23:37 
Tja das hat mir so richtig nicht geholfen

Er sagt :Unklare Definition IntVariable

Loetzinn ist nur ein beispiel für eine variable????!!!
result ist das auch nur eine Variable oder muss dass so sein??

Danke

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: So 08.01.06 00:03 
Hallo,

das war nur ein bloedsinniges Beispiel.
intVariable ist durch eine globale integer variable aus unit1 zu ersetzen.
Die Funktion Loetzinn erwartet keine Eingabedaten, sondern liefert nur die Variable aus Unit1 zurueck.Mal etwas anders
ausblenden 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:
{Hier unit1}
unit1
uses 
  ???
//globales i;
var 
var
 Form1: TForm1;
 i : integer;
implementation
var 
  j : integer;
procedure TForm1.Button1Click(Sender:TObject);
 ..........
end.

{Jetzt unit2}
unit2 
 uses ????

var
  i : integer;
implmentation
uses 
  unit1;
...mache irgendwas
i:= unit1.i;//muesste funktionieren
i:= unit1.j;//duerfte nicht funktionieren
...


Gruss Horst
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 08.01.06 10:12