[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
CLASS METHOD
Synopsis
Declare class method(s)
Syntax
CLASS METHOD <method name list>
Arguments
<method name list> is a list of names of methods to be
declared. The names are separated by commas. Each method declared
should be defined later in the same module using the METHOD
definition command.
Description
Declares one or more class methods, and corresponding messages
with the same names.
A class method applies to an entire class, rather than to a single
instance of a class. Inside a class method, the self variable
refers to the class object via which the method was invoked.
Class variables are thus directly accessible inside class
methods, by sending messages to self.
See the section on Class Methods for more information.
Notes
If a message and its method cannot have the same name for some
reason, the CLASS MESSAGE...METHOD command should be used
instead.
If a class uses class variables, it is often necessary to
initialize them when that class is created. To assist with this,
if a class defines a class method called initClass, the method
will be invoked automatically when the class is first created.
This allows one-time initialization of class variables. The
initClass method should be declared as follows:
CLASS METHOD initClass
and defined after the class specification using the METHOD
definition command. See the Class Initialization section
for more information.
See Also
CLASS MESSAGE...METHOD, Class Messages, Class Methods,
Class Variables, Class Initialization
See Also:
CLASS MESSAGE...METHOD
Class Messages
Class Methods
Class Variables
Class Initialization
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson