countarray( variable )


Parameters

  Type Description
variable rvalue variable to count

_result

Set to a numeric value that is the number of array elements.

Descriptions

Sets _result to the number of array elements in variable. Only the first level array elements of variable are included.  Any arrays that exist on array or property elements below variable are not included.  In the example below, the first call to msgbox will display 2 while the second will display 1. This is because there are two array elements on var (these are var[0] and var[1]) and one array element on var[0] (this is var[0][0]).

var[0] = 10
var[1] = 10
var[0][0] = 20

countarray( var )
msgbox( _result )

countarray( var[0] )
msgbox( _result )


For more information see the user variables topic.

See Also

cleararray, setarraycount, clearprops, hasprop, countprops, getpropname, assignment (=), copy, initialize, clear, isequal, user variables