AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Auf Variable aus Unit1 in Unit2 zugreifen
Thema durchsuchen
Ansicht
Themen-Optionen

Auf Variable aus Unit1 in Unit2 zugreifen

Ein Thema von marc.beeh · begonnen am 6. Feb 2004 · letzter Beitrag vom 8. Feb 2004
Antwort Antwort
Bit Juggler
(Gast)

n/a Beiträge
 
#1

Re: Auf Variable aus Unit1 in Unit2 zugreifen

  Alt 6. Feb 2004, 22:29
Hi marc,

Du musst im Implementations Abschnitt die Units einbinden!
Die Variablen die Du aus Unit1 in Unit2 benutzen willst müssen im Interface Berreich deklariet sein, das hattest Du ja soweit richtig!
Hie ein simples Beispiel:

Delphi-Quellcode:
// Unit1
var
  Form1: TForm1;
  AusUnit1: String;

implementation

{$R *.dfm}

uses
  Unit2;


procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.Show;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  AusUnit1:= 'Ein Gruß aus Unit1';
end;
Ubd weiter:
Delphi-Quellcode:
// Unit2
var
  Form2: TForm2;

implementation

{$R *.dfm}

uses
  Unit1;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Edit1.Text:= AusUnit1;
end;

Gruß Bit
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:38 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz