CMatrixRow:Remove


The Remove method removes the CMatrixRow member at index n.

Syntax

value = CMatrixRow:Remove( nIndex )

where

    nIndex is the index of the member to be removed. On failure, nil is returned.

  

The return value corresponds to whatever type was saved into the CMatrixRow at the specified index. This may be a number, string, or other quantity.

Example

The following script removes the member at index nIndex = 10:

R = CMatrixRow:new()

-- create a CMatrixRow object

R:Set( 2, "s1" )

-- set member [2]

R:Set( 10, "s2" )

-- set member [10]

R:Set( 100, "s3" )

-- set member [100]

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

-- result: N = 3

v = R:Remove( 10 )

-- remove member [10]

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

-- result: N = 2, v='s2'

Related Topics

Count

CMatrixRow class