CMatrix:RemoveRow CMatrix:Rows

CMatrix:RowExists


The RowExists method returns true if the CMatrix contains a row at index n.

Syntax

bTrue = CMatrix:RowExists( n )

bullet.gif    n is the index of the row to be tested.

bullet.gif    If the row exists at index n, true is returned.

bullet.gif    If the row does not exists, false is returned.

Remarks

Since Lua matrices are sparse, there does not need to be a row at index n. Moreover, the CMatrix cannot contain a row having less than 1 column. If true is returned, then a row exists at index n and it contains at least 1 column member.

Example

The following script returns false (printed as integer value 0) after a row is removed, then tested:

M = new_matrix()

-- create a CMatrix object

M:Set( 1, 4, "s1")

-- set member in row 1

M:Set( 1, 10, "s2")

-- set member in row 1

M:Set( 2, 18, "s3")

-- set member in row 2

M:Set( 2, 120, "s4")

-- set member in row 2

M:RemoveRow( 2 )

-- remove the row at index 2

Printf("Exists = %d",M:RowExists(2))

-- result: Exists = 0

Related Topics

CMatrix class, Exists


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.