Also known as a Class Method.
A code routine that belongs to the class or an object instance (an instance of the class). Methods that belong to the class are called class methods or static methods. Methods that belong to an object instance are called instance methods, or simply methods.
When a method returns a value, it is a function method. When no value is returned (or void), it is a procedure method.
Methods frequently use method parameters to transfer data. When one object instance calls another object instance using a method with parameters, you call that messaging.
Delphi Prism Member Method
Prism uses the keyword method for member methods and is the preferred syntax over the legacy procedure and function keywords. Although method is preferred, you can use procedure or function if you want the compiler to make sure all functions return a value and all procedures do not.
Syntax Example: In the interface section:
Cyborg = class(System.Object)
public method IntroduceYourself();
end;
In the Implementation section:
method Cyborg.IntroduceYourself();
begin
MessageBox.Show("Hi, I do not have a name yet.");
end;
On some event like a button click:
var T1: Cyborg;
begin
T1 := New Cyborg;
T1.IntroduceYourself;
end;