Try OpenEdge Now
skip to main content
Object-oriented Programming
Designing Objects: Inheritance, Polymorphism, and Delegation : Class hierarchies and inheritance : Calling up the class hierarchy : THIS-OBJECT system reference
 
THIS-OBJECT system reference
THIS-OBJECT is a system reference available for use within an instantiated class. At run time, it returns the currently running instance of the class as an object reference. You can optionally use THIS-OBJECT to access class members defined within the current class hierarchy.
The THIS-OBJECT system reference is different from the THIS-OBJECT statement. You can only execute the THIS-OBJECT statement within a constructor and it invokes another constructor in the same class definition.
This is the syntax to access local class members and class members defined within the current class hierarchy using the THIS-OBJECT system reference:

Syntax

THIS-OBJECT [ : class-member-reference]
class-member-reference
A reference to an instance variable data member, instance property, or instance method defined within the current class hierarchy. Any variable data member cannot be defined as an array (with an EXTENT).