Call static methods from inside the defining class
- Last Updated: October 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
ABL imposes two specific requirements for calling static methods within a class hierarchy:
- You cannot use the
SUPERsystem 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 Call overridden and super-class static methods. - If the method name is a reserved keyword, you cannot use the
THIS-OBJECTsystem 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:
|
However, if the method is defined in the acme.myObjs.Common.CommonObj class,
you can call it within the defining class hierarchy as follows:
|