:
This message was edited by injektilo at 2003-7-17 9:44:22
: this is the core of delphi, the class method is build in into the compiler itselve, not available for us.
:
: when calling it, it runs some code to register the class for windows wheter it is an object class or other, delphi knows what to do with it.
:
: so TObject is the first class object created with the classmethod and you should start from there, or if you are programming a compiler then you should start to learn ASM :)) (wich you probebly allready have)
:
:
:
A class method is not something for the core of Delphi, but a method, which can also be applied to the class definition itself. Example:
procedure TForm1.Button1Click(Sender: TObject);
begin
Button1.Caption := TButton.ClassName; // a class function
end;
This code will show the name of the class itself, not an instance of the object. Since ClassName() is a class method (see help file), this is a valid code, while the following code will generate an error:
procedure TForm1.Button1Click(Sender: TObject);
begin
TButton.Click; // not a class method
end;
The Click() method cannot be called from the class definition of a TButton, but only from an TButton instance.