2
A procedure or function (i.e. method) declaration (including class procedures and class functions)
3
A property declaration (including class properties)
4
A constructor or destructor declaration
5
A visibility scope specifier (public, private,
protected, published,
strict private, and strict protected)
For example:
type
TMyClass = class
public
class var // Introduce a block of class static fields.
Red: Integer;
Green: Integer;
Blue: Integer;
procedure Proc1; // Ends the class var block.
end;
The above class fields can be accessed with the code:
TMyClass.Red := 0;
TMyClass.Green := 0;
TMyClass.Blue := 0;
139
Methods
A method is a procedure or function associated with a class. A call to a method specifies the object (or, if it is a class
method, the class) that the method should operate on. For example,
SomeObject.Free
calls the
Free
method in
SomeObject
.
This topic covers the following material:
Methods declarations
and implementation
Method binding
Overloading
methods
Constructors and destructors
Message methods
Dostları ilə paylaş: