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

Supporting ABL

In addition to ABL for defining and using class-based objects, the following ABL elements support programming with class-based objects:
*SUPER statement — Within a class constructor, this statement invokes the constructor with the matching signature in the immediate super class. For more information, see see Constructingan object.
*SUPER system reference — Invokes the specified method as implemented or inherited by the immediate super class. Analogous to the RUN SUPER statement or SUPER function in procedure-based programming. For more information, see see Constructingan object.
*CAST or DYNAMIC-CAST function — Allows a class object reference to be assigned to a data element defined as a subclass or interface object reference. For more information, see Object reference assignment and casting.
*TYPE-OF function — Verifies the type of an object. For more information, see TYPE-OF function.
*VALID-OBJECT function — Validates that an object reference points to a real object. Analogous to the VALID-HANDLE function for internal object handles. For more information, see VALID-OBJECTfunction.
*THIS-OBJECT statement — Invokes a constructor of the defining class (specified by its signature) from another constructor of the same class. For more information, see see Constructingan object.
*THIS-OBJECT system reference — Returns an object reference to the current object from a method within the class hierarchy of the object. Also used to call a method from within the class hierarchy where it is defined when the method name is identical to an ABL keyword. Analogous to the THIS-PROCEDURE system handle for procedures. For more information, see THIS-OBJECTsystem reference.
*FIRST-OBJECT attribute — A SESSION system handle attribute that returns an object reference to the first class-based object instantiated in an ABL session. Analogous to the FIRST-PROCEDURE attribute for persistent procedures. You can use the NEXT-OBJECT property of any class to walk the list of instantiated class-based objects forward from the first to the most recent object currently instantiated in the session. All ABL classes inherit NEXT-OBJECT from the root class, Progress.Lang.Object. For more information on the FIRST-OBJECT attribute and the NEXT-OBJECT property, see ABL session object reference attributes.
*LAST-OBJECT attribute — A SESSION system handle attribute that returns an object reference to the most recent class-based object instantiated in an ABL session. Analogous to the LAST-PROCEDURE attribute for persistent procedures. You can use the PREV-OBJECT property of any class to walk the list of instantiated class-based objects backward from the most recent to the first object currently instantiated in the session. All ABL classes inherit PREV-OBJECT from the root class, Progress.Lang.Object. For more information on the LAST-OBJECT attribute and the PREV-OBJECT property, see ABL session object reference attributes.
*UNDO, THROW option — Available on several ABL constructs, this option provides a means to raise ERROR by throwing an error object that can be handled in a variety of ways, depending on the context. An error object can be an instance of several built-in ABL classes that implement the Progress.Lang.Object interface, including an application error class that you can extend according to your application requirements. For more information on error handling with classes, see Raising and handling error conditions.
*RETURN statement and options — From a method, returns a value or returns ERROR, depending on the method definition and RETURN options:
*Without the ERROR option, sets the return value of a non-VOID method according to its defined data type
*With the ERROR option, returns ERROR and optionally returns an error string (read by the RETURN-VALUE function in the caller) or returns a specified error object. If the method is a constructor, this also cancels and reverses any class instantiation. For more information, see Defining data members within a class or Definingclass constructors.
The RETURN also works the same way as an option of various ON phrases (such as the ON ERROR phrase) and on the UNDO statement. For more information on error handling with classes, see Raising and handling error conditions.
*ROUTINE-LEVEL ON ERROR UNDO, THROW statement — Changes the default error handling for procedures, user-defined functions, methods, and constructors so that any error object that has been thrown to the routine block is passed up to the caller of the routine. For more information on error handling with classes, see Raising and handling error conditions.
*CATCH statement — Catches and allows access to a specified type of error object that has been raised within the same ABL block. For more information on error handling with classes, see Raising and handling error conditions.