Supporting ABL
- Last Updated: January 13, 2015
- 3 minute read
- OpenEdge
- Version 13.0
- Documentation
In addition to ABL for defining and using class-based objects, the following ABL elements support programming with class-based objects:
-
SUPERstatement — Within a class constructor, this statement invokes the constructor with the matching signature in the immediate super class. For more information, see see Construct an object. -
SUPERsystem reference — Invokes the specified method as implemented or inherited by the immediate super class. Analogous to theRUN SUPERstatement orSUPERfunction in procedure-based programming. For more information, see see Construct an object. -
CASTorDYNAMIC-CASTfunction — 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-OFfunction — Verifies the type of an object. For more information, see TYPE-OF function. -
VALID-OBJECTfunction — Validates that an object reference points to a real object. Analogous to theVALID-HANDLEfunction for internal object handles. For more information, see VALID-OBJECT function. -
THIS-OBJECTstatement — Invokes a constructor of the defining class (specified by its signature) from another constructor of the same class. For more information, see see Construct an object. -
THIS-OBJECTsystem 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 theTHIS-PROCEDUREsystem handle for procedures. For more information, see THIS-OBJECT system reference. -
FIRST-OBJECTattribute — ASESSIONsystem handle attribute that returns an object reference to the first class-based object instantiated in an ABL session. Analogous to theFIRST-PROCEDUREattribute for persistent procedures. You can use theNEXT-OBJECTproperty 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 inheritNEXT-OBJECTfrom the root class,Progress.Lang.Object. For more information on theFIRST-OBJECTattribute and theNEXT-OBJECTproperty, see ABL session object reference attributes. -
LAST-OBJECTattribute — ASESSIONsystem handle attribute that returns an object reference to the most recent class-based object instantiated in an ABL session. Analogous to theLAST-PROCEDUREattribute for persistent procedures. You can use thePREV-OBJECTproperty 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 inheritPREV-OBJECTfrom the root class,Progress.Lang.Object. For more information on theLAST-OBJECTattribute and thePREV-OBJECTproperty, see ABL session object reference attributes. -
UNDO, THROWoption — Available on several ABL constructs, this option provides a means to raiseERRORby 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 theProgress.Lang.Objectinterface, including an application error class that you can extend according to your application requirements. For more information on error handling with classes, see Raise and handle error conditions. -
RETURNstatement and options — From a method, returns a value or returnsERROR, depending on the method definition andRETURNoptions:- Without the
ERRORoption, sets the return value of a non-VOIDmethod according to its defined data type - With the
ERRORoption, returnsERRORand optionally returns an error string (read by theRETURN-VALUEfunction 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 Define data members within a class or Define class constructors.
The
RETURNalso works the same way as an option of variousONphrases (such as theON ERRORphrase) and on theUNDOstatement. For more information on error handling with classes, see Raise and handle error conditions. - Without the
-
ROUTINE-LEVEL ON ERROR UNDO, THROWstatement — 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 Raise and handle error conditions. -
CATCHstatement — 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 Raise and handle error conditions.