Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mo 06.06.05 14:56 
Hallo, gibts in Delphi sowas wie in Java mit static deklariert wird?
Also was in Java static deklariert habe darauf kann ich mit classenname
z.B. TObject.procedur oder TObject.object zugreifen was für alle Instanzen
ein zentralles Object oder Procedur ist!
Grendel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 443

Gentoo Linux, MacOS X, Win 2000
D5 Ent, D7 Ent, Lazarus, Anjuta, MonoDevelop
BeitragVerfasst: Mo 06.06.05 15:00 
user profile iconJRegier hat folgendes geschrieben:
Hallo, gibts in Delphi sowas wie in Java mit static deklariert wird?
Also was in Java static deklariert habe darauf kann ich mit classenname
z.B. TObject.procedur oder TObject.object zugreifen was für alle Instanzen
ein zentralles Object oder Procedur ist!


Guckst Du nach class function

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  TMyObj = class(TObject)
    [...]
  public
   class function Test(): String;
  [...]

implementation
 [...]

function TMyObj.Test(): String;
begin
  Result := 'iregendwas';
end;


Zugreifen kannst Du dann so
ausblenden Delphi-Quelltext
1:
  TMyObj.Test();					


Bis neulich ...
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Do 09.06.05 09:09 
Vielen Dank! Für Info :wink: