CArray:MaxIndex
The MaxIndex method returns the maximum member index in the CArray.
nIndex = CArray:MaxIndex() where |
nIndex is te maximum index used in the CArray. On failure, 0 is returned.
This method returns the maximum member index. Since all indices do not have to be packed in a sparse array, the returned value is not the same as the number of values in the array. This is the same as the number of members needed to hold every possible integral index between 1 and MaxIndex. For example, if the CArray has two members, one at index [1] and the other at index [10000], then MaxIndex = 10000.
Suppose a CArray assigned to A contains 3 members as shown below:
|
-- create a CMatrix |
|
-- set member [2] |
|
-- set member [50] |
|
-- set member [120] |
|
-- result: N = 120 |