Try OpenEdge Now
skip to main content
GUI for .NET Primer
Object-oriented Programming in ABL : Classes : Methods


Similar to internal procedures and user-defined functions in procedure files, methods provide behavior in class files. Methods can have parameters and can define a return type. A method can also have a return type of VOID, which means that it does not return a value, and is therefore comparable to an internal procedure, as opposed to a function.
Like data members and properties, methods can be defined with an access mode, either PUBLIC, PROTECTED, or PRIVATE, that determines where and how the method is called. Methods are PUBLIC by default.
As with internal procedures and user-defined functions, you can raise ERROR within a method or property GET accessor or SET accessor using RETURN ERROR or UNDO, THROW. This statement allows you to raise (THROW) an error as an object. An error object, part of the structured error handling feature introduced in OpenEdge Release 10.1C, is a class-based object that can be trapped with custom error handlers.