Define a class in Developer Studio
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
The New ABL Class wizard helps you define an ABL class. You start the
wizard in the workspace directory where you want to create the ABL class file. This is
typically in a directory underneath the src directory
for a project.
In the wizard, the package is automatically set by the location in the directory structure where you start the wizard. You must specify the class name. As a best practice, you should select the method stubs for the default constructor and destructor. In addition, you should retain the default error-handling generated by the wizard.
It is always a good practice to provide information that describes the class.
When the New ABL Class wizard ends, the class file is created in the package location in the workspace and opens in the editor.
Example
Here is an example of the code that the New ABL Class
wizard generates for the Emp class. A using statement is the first statement in this file. It
specifies that this class will use all the built-in classes defined in the Progress.Lang package. The block
level error-handling is then specified. The name of the class is Emp and the name of the file is Emp.cls. This file resides in the Enterprise.HR package, which maps to the
Server/src/Enterprise/HR directory in the workspace.
The class definition begins with the class keyword, followed by the fully qualified class name, which includes
the package. The class definition ends with the end
class statement. This class currently does not have any data defined. It
has the default public
constructor and destructor defined, but not implemented.
//---------------------------------------
File : Emp
Purpose : Used by HR component
Syntax :
Description : Employee of the company
Author(s) : Created : Fri Sep 12 14:45:07
Notes :
//-----------------------------------------
using Progress.Lang.*.
block-level on error undo, throw.
class Enterprise.HR.Emp:
constructor public Emp ( ):
super ().
end constructor.
destructor public Emp ():
end destructor.
end class.