Click or drag to resize

AMembers Function

X#
-- todo --
Places the names of properties, procedures, and member objects for an object into a variable array.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION AMembers(
	ArrayName,
	oObjectNameOrClassName,
	nArrayContentsID,
	cFlags
) AS USUAL CLIPPER
Request Example View Source

Parameters

ArrayName (Optional)
Type: Usual
Specifies the array into which the names of the member properties for oObjectName are placed. If you specify the name of an array that doesn't exist, the array is automatically created. If the array isn't large enough to contain all the names, X# automatically increases the size of the array.
oObjectNameOrClassName (Optional)
Type: Usual
Specifies the object or X# class whose member properties are placed in the variable array specified with ArrayName. This can be any expression that evaluates to an object, such as an object reference, an object variable, or an object array element.
nArrayContentsID (Optional)
Type: Usual
Specifies the contents of an array.
cFlags (Optional)
Type: Usual
Specify the filtering applied to the array returned by the AMembers( ) function. cFlags will not function when AMembers( ) is passed a COM object (the value of ArrayContentsID is 3). Some flags are mutually exclusive so that if you use more than one cFlag, use them in the following groupings:
1[P | H | G] [N | U] [C] [I | B] [R]

Return Value

Type: Usual
Numeric
Remarks
Description
0 Specifies that the array contains a single column of property names. Omitting the nArrayContentsID parameter is the same as passing a 0.
1 Specifies that the array contains the names of the properties of the object or class, as well as the methods and member objects. The resulting array is two-dimensional with the second column specifying what type of member is listed in the first column. The possible values for the second column are Property, Event, Method, or Object.
2 Specifies that the array contains the names of objects that are members of a native X# object specified with oObjectName. The resulting array is one-dimensional. This option provides a method to determine the names of child objects in a container such as all Form objects in a form set or controls in a form.
3 Specifies that the array contains information about one or more objects. You can pass an object reference to either a native X# object or to a COM object.
Note Note
A value of 3 for this parameter is not supported in .app or .exe applications.
The array returned when you specify this parameter consists of four columns as described in the table in the remarks section:
ColumnDescription
1Name of the event or method
2Property type (for example, PROPERTYPUT, PROPERTYGET, PROPERTYPUTREF, METHOD)
3 Function signature (parameters and their types, and the function return type). This information is similar to the Quick Info text provided in IntelliSense expansion of a method.
4Help string
If you omit nArrayContentsID, AMembers( ) returns a one column array of properties.

The tables below describe the valid values for cFlags.
ValueFilter Flags
PProtected properties, methods, or events
HHidden properties, methods, or events
GPublic properties, methods, or events
NNative (Intrinsic) properties, methods, or events
UUser-Defined (Extrinsic) properties, methods, or events
CChanged properties (but not changed array properties)
IInherited properties, methods, or events
BBase properties, methods, or events (using the AddProperty method)
RRead-Only Properties
The default configuration for the filtering specified by cFlags is logical OR between flags. You can change this by using the special "+" cFlags.
ValueSpecial Flags
#Adds a new column to the output array with the corresponding cFlags value.
+Performs logical AND between filter flags.
AMembers( ) returns the number of objects, properties, and procedures for the object, or 0 if the array cannot be created. If you omit the optional 1, 2, or 3 flag parameters, a one-dimensional array is created containing the properties of oObjectName. You can pass COM object references to the AMembers( ) function, but when you do so, you must also pass a value of 3 in the third (flag) parameter, as in the following example.
X#
1oExcel = CreateObject("excel.application")
2= AMembers(gaPropArray, oExcel, 3)
Examples
X#
1Clear
2goForm1 = CreateObject("Form")  // Creates a Form
3= AMembers(gaPropArray, goForm1, 1)  // Array containing Form properties
4Display MEMORY LIKE gaPropArray  // Display the Form properties
See Also