Defining a Class

Defining a class is accomplished using the Define Class/EndDefine construct. Let's take a look at the structure of the construct as a whole, and then we'll take it apart piece by piece.


DEFINE CLASS <classname> AS <baseclass>
    *-- Declaration Code Here
    PROTECTED <list of member variables>

    PROCEDURE <methodproc> (param1, param2 ....)
        LOCAL <list of local variables>
        *-- Procedure Code Here
    ENDPROC

    FUNCTION <methodfunc> (param1, param2 ....)
        LOCAL <list of local variables>
        *-- Function code here
        RETURN <returnval>
    ENDFUNC
ENDDEFINE