This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Returns the number of elements of an array dimension
Syntax
n = CountOf(ArrayVariable[ (Dimension) ])
n = CountOf(ArrayVariable[, Dimension ])
Returns
Number
Parameters
Name |
Type |
Optional |
Meaning |
ArrayVariable |
No |
Name of a declared array. |
|
Dimension |
Number |
Yes |
The dimension number inside the array. If no dimension is specified, the first dimension will be used. |
Remarks
For not yet dimensioned arrays functions will return 0 (zero).
Restrictions
See also
Examples
DIM MyArray(4, 8, 3) as LONG
MSGBOX 0, CountOf(MyArray) '---Will return 4
MSGBOX 0, CountOf(MyArray(1)) '---Will return 4
MSGBOX 0, CountOf(MyArray(2)) '---Will return 8
MSGBOX 0, CountOf(MyArray(3)) '---Will return 3
REDIM MyArray(4, 8, 30)
MSGBOX 0, CountOf(MyArray, 3) '---Will now return 30