A class is declared using a Class Declaration statement. The syntax of the class declaration statement is:
Class {class-name} is a {superclass}
[
Procedure Construct_Object
Forward Send Construct_Object
{property-declarations}
{private-objects}
End_Procedure
]
[{method-declarations}]
End_Class
Where:
{class-name} is the name of the new class (also called subclass) and
{superclass} is the name
of an existing class that the new class is derived from.
Each class inherits all components of its superclass. Each inherited
method may be augmented, overridden or canceled inside the new class
declaration. You may define new properties, methods and private objects
inside the class constructor method (this is fully explained in the
following sections). The end of the class declaration block is marked
by the End_Class command.
DataFlex provides a library of high-level classes that are designed to perform most of the functionality you need for building database applications. You can use these built-in classes as the foundation of your own extended class library from which you would construct your applications. The Class Reference contains a complete listing of every class in the Class Library.
An example of a simple class declaration is:
Class cOKButton is a Button
End_Class
This example declares a new class called cOKButton that is based on the built-in Button class. This new class will perform exactly as its superclass (Button). Since there are no new properties, methods or private objects there would be no new behavior associated with the new class.
DataFlex naming convention suggests that you prefix your new class names with a "c". This will help you ensure that no naming conflict will occur between your class and other identifiers in your program.