Compartir a través de


Programmatic Class Definitions

In a program file, you can have program code prior to the class definitions, but not after the class definitions, in the same way that program code cannot come after procedures in a program. The basic shell for class creation has this syntax:

DEFINE CLASS ClassName1 AS ParentClass [OLEPUBLIC]
   [[PROTECTED | HIDDEN PropertyName1, PropertyName2 ...]
      [Object.]PropertyName = eExpression ...]
   [ADD OBJECT [PROTECTED] ObjectName AS ClassName2 [NOINIT]
      [WITH cPropertylist]]...
   [[PROTECTED | HIDDEN] FUNCTION | PROCEDURE Name[_ACCESS | _ASSIGN]
      [NODEFAULT]
      cStatements
   [ENDFUNC | ENDPROC]]...
ENDDEFINE

See Also

Writing Class Definitions Programmatically | Event Response | Protection and Hiding of Class Members | Calling Methods | Setting Properties | Object-Oriented Programming