Class Declaration

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:

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.