CArray:Count
The Count method returns the number of members in the CArray object.
nCount = CArray:Count() where |
nCount is the number of elements in the array. On failure, 0 is returned.
This method returns the number of members (or values) in the CArray. This is not the same thing as the maximum index in the array. For example, if the CArray has 2 members, one at index 1 and the other at index 10000, then Count = 2.
Suppose a CArray assigned to A contains 3 members as shown below:
|
-- create a CArray |
|
-- set member 2 |
|
-- set member 50 |
|
-- set member 120 |
|
-- result: N = 3 |
|
-- if finished with A, clean up memory |