THIS-OBJECT system reference
An object reference to the currently running class instance that you can optionally use to access class members defined within the current class hierarchy.
Syntax
class-member-reference
ExampleThe following code fragment shows two instance methods defined within a class, where you must qualify a call to one of them with THIS-OBJECT because its name,
Display
, is an ABL reserved keyword:
Notes
- You can use THIS-OBJECT without a method call to pass an object reference to the currently running object instance as a parameter, or to return an object reference to itself as a method return value.
- Use of the THIS-OBJECT system reference to call instance methods that are available within the class hierarchy where they are defined is generally optional. However, you must use the THIS-OBJECT system reference to call any instance method whose name is identical to an ABL reserved keyword. The same is true if you are calling an event method on a class-defined or inherited instance event of a class whose name is identical to an ABL reserved keyword. For more information, see the Class-based method call reference entry and the "Class Events Reference" section.
- Use of the THIS-OBJECT system reference to access instance variable data members or properties that are available within the class hierarchy where they are defined is optional. However, you must use the THIS-OBJECT system reference to access any such data member or property whose name is identical to an ABL reserved keyword. For more information, see the Class-based data member access and Class-based property access reference entry.
- You cannot use the THIS-OBJECT system reference to access a static class member.
- To invoke other constructors defined within the current class, use the THIS-OBJECT statement.
See also
OpenEdge Release 10.2B
|