CMatrixRow:Exists


The Exists method returns true if a CMatrixRow member exists with the specified indices.

Syntax

bSuccess = CMatrixRow:Exists( index )

where

    index is the index of the member to test.

    bSuccess is the returned success code. On success it is true, otherwise false.

  

If you use Init then the first n members are set and this function will return true if tested with an index in range. Otherwise, members are not initialized if you do not Set them or if you Remove them.

Example

The following script tests whether the array member at index [2] has been initialized:

R = CMatrixRow:new()

-- create a CMatrixRow

R:Set( 1, 0.112 )

-- set member [1]

R:Set( 2, 5.5 )

-- set member [2]

if ( R:Exists(6) ) then

-- has member [6] been set?

  s = "yes"

 

else

 

 s = "no"

 

end

 

Printf("R[6] exists= %s", s )

-- result: R[6] exists= no

Related Topics

Count

CMatrixRow class