Previous Next

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 
 
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).
Example 
The 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:
 
CLASS TestClass: 
 
  METHOD VOID Display( ):
 
  END METHOD.
 
  METHOD VOID Foo( ):
 
    THIS-OBJECT:Display( ).
 
  END METHOD.
 
END CLASS.
Notes 
*
*
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.
*
See also 
Class-based method call, THIS-OBJECT statement

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.