CMatrixRow:Count


The Count method returns the number of members in the CMatrixRow object.

Syntax

nCount = CMatrixRow: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 CMatrixRow. This is not the same thing as the maximum index in the array. For example, if the CMatrixRow has 2 members, one at index 1 and the other at index 10000, then Count = 2.

Example

Suppose a CMatrixRow assigned to R contains 3 members as shown below:

R = CMatrixRow:new()

-- create a CMatrixRow

R:Set( 2, 1805 )

-- set member 2

R:Set( 50, 102 )

-- set member 50

R:Set( 120, 600.5 )

-- set member 120

Printf("N = %d", R:Count() )

-- result: N = 3

Related Topics

Exists

CMatrixRow class