Zitat von
http://edn.embarcadero.com/article/34324:
Classes can now have class constants -- a constant value associated with the class itself and not an instance of the class.
Delphi-Quellcode:
type
TClassWithConstant = class
public
const SomeConst = 'This is a class constant';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShowMessage(TClassWithConstant.SomeConst);
end;
In nicht ganz so alten Delphi Versionen sollte das da gehen. Wobei es bei meinem Delphi 7 nicht geht obwohl auf der Seite steht dass es ab Delphi 7 geht (oder hab ich was falsch verstanden?)
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."