Method Abstract():classDescribe() Foundation

Reflects the class definition

Syntax
:classDescribe( [<nInfo>] ) --> aReturn
Parameters
<nInfo>
A #define constant from CLASS.CH must be used for this parameter. It defaults to CLASS_DESCR_ALL and defines the type of information included in the return value.
Constants for :classDescribe()
Constant Return value
CLASS_DESCR_ALL *) All available information in one array
CLASS_DESCR_CLASSNAME Class name as character string
CLASS_DESCR_SUPERCLASSES One-dimensional array holding the class objects of all superclasses
CLASS_DESCR_MEMBERS 3-column array holding information about member variables
CLASS_DESCR_METHODS 5-column array holding information about methods
CLASS_DESCR_SUPERDETAILS 3-column array holding details about superclasses
  1. default
Return

If <nInfo> is omitted or set to CLASS_DESCR_ALL, an array with four elements is returned. They contain the information resulting from passing one of the following constants to this method:

obj:classDescribe()  -->   { CLASS_DESCR_CLASSNAME   , ; 
                             CLASS_DESCR_SUPERCLASSES, ; 
                             CLASS_DESCR_MEMBERS     , ; 
                             CLASS_DESCR_METHODS       } 

The elements of this array reflect the parameter profile of the function ClassCreate().

CLASS_DESCR_CLASSNAME

The class name as character string.

CLASS_DESCR_SUPERCLASSES

One-dimensional array containing the class objects of the superclasses.

CLASS_DESCR_MEMBERS

Two-dimensional array with three columns. It holds information about member variables of the class. Each column can be accessed using the following #define constants:

Constants for the member-variable array
Constant Description
CLASS_MEMBER_NAME Character string representing the name of a single member variable
CLASS_MEMBER_ATTR Member variable attributes as numeric
CLASS_MEMBER_TYPE Reserved

CLASS_DESCR_METHODS

Two-dimensional array with five columns. It holds information about methods of the class. Each column can be accessed using the following define constants:

Constants for the method array
Constant Description
CLASS_METHOD_NAME Character string with the name of the method
CLASS_METHOD_ATTR Method attributes as numeric
CLASS_METHOD_BLOCK Method code block, if the method was dynamically created with ClassCreate()
CLASS_METHOD_VARNAME The name of the redirected variable if it is an ACCESS|ASSIGN method
CLASS_METHOD_TYPE Reserved

CLASS_DESCR_SUPERDETAILS

Two-dimensional array with three columns. It holds detailed information about the superclasses of the class. Note that this array is not included in the CLASS_DESCR_ALL array. It is only returned when CLASS_DESCR_SUPERDETAILS is passed to :classDescribe().

Constants for the superclass details array
Constant Description
CLASS_SUPERCLASS_NAME Character string representing the name of the superclass
CLASS_SUPERCLASS_ATTR Class attributes
CLASS_SUPERCLASS_TYPE Reserved

Description

The generic method :classDescribe() is used to inspect the structure of a class and its superclasses at runtime. Individual information about member variables, methods or superclasses can be obtained by passing the corresponding #define constants to this method. If :classDescribe()is called without a parameter, the returned array reflects the parameter profile of the ClassCreate() function. This allows for easy creation or modification of the structure of dynamic classes.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.