Difference between revisions of "Method"

From Lazarus wiki
Jump to navigationJump to search
(Deleted category because category mentioned in template)
(Undo revision 117754 by FTurtle (talk))
Line 4: Line 4:
  
 
== self identifier ==
 
== self identifier ==
Inside method definitions the special identifier is available.
+
Inside method definitions the special identifier <syntaxhighlight lang="pascal" enclose="none">self</syntaxhighlight> is available.
In class methods it identifies the <syntaxhighlight lang="pascal" enclose="none">object</syntaxhighlight>/<syntaxhighlight lang="pascal" enclose="none">class</syntaxhighlight> type itself. In static methods <syntaxhighlight lang="pascal" enclose="none">Self</syntaxhighlight> is not defined.
+
In static or class methods it identifies the <syntaxhighlight lang="pascal" enclose="none">object</syntaxhighlight>/<syntaxhighlight lang="pascal" enclose="none">class</syntaxhighlight> type itself.
 
In instance methods <syntaxhighlight lang="pascal" enclose="none">self</syntaxhighlight> identifies the very instance.
 
In instance methods <syntaxhighlight lang="pascal" enclose="none">self</syntaxhighlight> identifies the very instance.

Revision as of 14:46, 26 May 2018

English (en) français (fr) русский (ru)

A method is a routine that is associated with an object or class.

self identifier

Inside method definitions the special identifier self is available. In static or class methods it identifies the object/class type itself. In instance methods self identifies the very instance.