ASELOBJ( ) Function

Example   See Also

Places object references to currently selected controls in the active Form Designer into a variable array.

Syntax

ASELOBJ(ArrayName, [1 | 2])

Returns

Numeric

Arguments

ArrayName

Specifies the name of the array containing the object references of the currently selected controls. If the array you specify doesn't exist, Visual FoxPro automatically creates the array. If the array exists and isn't large enough to contain all the control information, Visual FoxPro automatically increases the size of the array to accommodate the information. If the array is larger than necessary, Visual FoxPro truncates the array. If the array exists and ASELOBJ( ) returns 0 because no controls are currently selected, the array remains unchanged. If the array doesn't exist and ASELOBJ( ) returns 0, the array isn't created.

1

Creates a one-element array containing an object reference to the container for the currently selected control. For example, if the currently selected control is a spinner on a form, the array contains an element with the value "FORM." Include 1 when issuing ASELOBJ( ) from within the Command window. Note that if a page frame is selected, ASELOBJ( ) returns the name of the current page.

2

Specifies that Visual FoxPro creates a one-element array containing an object reference to the DataEnvironment object for the form. The DataEnvironment object allows you to determine the data environment properties for the form.

Remarks

ASELOBJ( ) creates a one-dimensional array containing object references to the currently selected controls in the active Form Designer and returns the number of currently selected controls. If no controls are currently selected and the optional 1 argument is omitted, ASELOBJ( ) returns 0 and the array isn't created. ASELOBJ( ) does not recognize the form as the selected control if there are no controls on the form. If no controls are currently selected and the optional 1 argument is included, ASELOBJ( ) returns 1.

You can use ASELOBJ( ) to create your own control builders.