CMatrix:Count
The Count method returns the number of rows defined in the CMatrix object.
number = CMatrix:Count() |
This method returns the number of rows defined in the CMatrix. This is not the same thing as the maximum index in the row direction. For example, if the CMatrix has 2 rows, one at index (1,1) and the other at index (5,10000), then there are 2 rows defined and Count = 2.
Suppose a CMatrix assigned to M contains 2 rows 3 members as shown below. This script fragment returns the count and the number of members:
|
-- create a CMatrix |
|
-- set member 2, 44 |
|
-- set member 120, 20 |
|
-- set member 120, 2 |
|
-- result: rows = 2 |
|
-- result: mem = 3 |
|
-- if finished with M, clean up memory |