Try OpenEdge Now
skip to main content
Object-oriented Programming
Object-oriented Programming and ABL : Overview of class-based ABL : Invoking methods
 

Invoking methods

You can invoke a method within a class that defines or inherits it simply by naming it and, if it returns as value, by including it in an expression, much as with a user-defined function, for example, GetItem( ). You can invoke a PUBLIC method defined in another object (outside the running class hierarchy) in a similar fashion, except that you must prefix the method name with a reference to the other object separated by a colon (:), for example, rInventory:GetItem( ). Invoking a method on (defined in) another object is analogous to invoking a built-in method on an ABL handle-based object, for example, ERROR-STATUS:GET-MESSAGE( ). To help support OERA-compliant applications, you can also use the DYNAMIC-INVOKE function, which allows you to invoke a method whose name is determined at run time. You can also invoke a method from criteria identified at run time using the Invoke( ) method of the Progress.Lang.Class class.
Outside of the class hierarchy where it is defined, you must invoke a PUBLIC static method by prefixing the method name with the class type rather than an object reference. For more information on static methods, see Using static members of a class.
For more information on invoking methods, see Calling class-based methods.
* Comparison with procedure-based programming