Try OpenEdge Now
skip to main content
Object-oriented Programming
Programming with Class-based Objects : Using static members of a class : Accessing static members : Calling static methods from inside the defining class
 
Calling static methods from inside the defining class
ABL imposes two specific requirements for calling static methods within a class hierarchy:
*You cannot use the SUPER system reference to call a static method in a super class. This system reference only works with an instance hierarchy. Instead, you can use static type-name syntax to call any static method in a super class. For more information on calling static methods in a super class, see Calling overridden and super-class static methods.
*If the method name is a reserved keyword, you cannot use the THIS-OBJECT system reference to call the method, as with instance methods. Instead, you must use static type-name syntax to call a method named with a reserved keyword from within its defining class.
For example, the ACCUMULATE keyword is reserved in ABL. If you have an accessible static Accumulate( ) method defined within the current class hierarchy, you cannot call it directly by name, as follows:
Accumulate( ). /* Compiler error */
However, if the method is defined in the acme.myObjs.Common.CommonObj class, you can call it within the defining class hierarchy as follows:
acme.myObjs.Common.CommonObj:Accumulate( ). /* Valid call */