AINSTANCE( ) Function

Places instances of a class into a variable array and returns the number of instances placed in the array.

AINSTANCE(ArrayName, cClassName)

Parameters

ArrayName

Specifies the name of the array into which the instances are placed. 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 instances, Visual FoxPro automatically increases the size of the array to accommodate the instances. If the array is larger than necessary, Visual FoxPro truncates the array. If the array exists and AINSTANCE( ) returns 0 because no instances are found, the array remains unchanged. If the array doesn't exist and AINSTANCE( ) returns 0, the array is not created.

Only class instances assigned to variables and array elements with CREATEOBJECT( ) or NEWOBJECT( ) are placed into the array.

cClassName

Specifies a Visual FoxPro base class name or a user-defined class name. For a complete list of the Visual FoxPro base classes, see Base Classes in Visual FoxPro.

Expand imageReturn Value

Expand imageExample

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic