[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Reference Objects
Reference objects are mainly for internal use, but they may be of use in
applications.
A reference object refers to another object, in much the same way that two
different variables in Clipper can refer to the same array (or object).
The difference is that a reference object can belong to a different class
from the object it refers to - it can belong to any class in the
superclass chain of the object it refers to. A reference object can be
obtained in one of two ways:
. By sending the classname of an ancestor class to an object. For
example, in the expression obj:rectangle, if obj belonged to a
class which had an ancestor class named Rectangle, a reference object
of class Rectangle would be returned. The resulting object refers to
the same object as obj, but will only handle messages belonging to
class Rectangle and its superclasses. This is similar to casting an
object pointer in C++.
. By sending the super message to an object. The expression
obj:super results in a reference object belonging to the
superclass of the class of obj, but referring to the same object
as obj.
See Also:
super
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson