[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Reference Objects
------------------------------------------------------------------------------
Reference objects were implemented mainly for internal and future use,
but 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 by sending
the super message to an object. For example:
oRef := obj:super
If obj belonged to a class which had an ancestor class, somewhere in
its tree, called Rectangle, then the above message would result in a
reference object, of class Rectangle,
The expression obj:super returns a reference to obj which is
'scoped' to the superclass of obj. This reference can be stored in
a variable, such as oRef in the example. oRef and obj refer to the
same object, but oRef will only handle messages belonging to obj's
superclass.
Note:
Class(y) also returns a reference object if you send a message
corresponding to the class name of an ancestor class to an object.
This feature may not be supported in future versions of Class(y).
See Also:
■ super
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson