AClass Function | |
-- todo --
Places an object's class name and its ancestor class names into a variable array.
Namespace:
XSharp.VFP
Assembly:
XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax FUNCTION AClass(
ArrayName,
oExpression
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual AClass(
Usual ArrayName = default,
Usual oExpression = default
)
Request Example
View SourceParameters
- ArrayName (Optional)
- Type: Usual
Specifies the name of the array into which the class names are placed.
- oExpression (Optional)
- Type: Usual
Specifies an object whose class name and ancestor class names are placed into the array.
oExpression can be any object expression, such as an object reference, an object variable, or an object array element.
Return Value
Type:
UsualNumeric
Remarks
If you specify the name of an array that doesn't exist, X# automatically creates the array.
If you specify the name of an existing array that isn't large enough to hold all the parent names, X# automatically increases the size of the array.
If the array is larger than necessary, the array size is truncated. If you specify the name of an existing two-dimensional array,
the array is redimensioned to a one-dimensional array.
AClass( ) creates a one-dimensional array containing the class name of the specified object and its ancestor class names.
The first array element contains the class name of the object, the second element contains the name of the object's parent class,
the third element contains the name of the object's grandparent class, and so on.
AClass( ) returns the number of class names in the array. AClass( ) returns 0 if the array cannot be created.
Examples 1Clear
2frmMyForm = CreateObject("FormGrandChild")
3For nCount = 1 TO AClass(gaNewarray, frmMyForm)
4? gaNewarray(nCount)
5ENDFor
6RELEASE frmMyForm
7DEFINE CLASS FormChild AS ForM
8ENDDEFINE
9DEFINE CLASS FormGrandChild AS FormChild
10ENDDEFINE
See Also