CMatrix:Get CMatrix:Init

CMatrix:GetRow


The GetRow method returns a reference to the CArray at the specified row.

Syntax

row = CMatrix:GetRow( n )

bullet.gif    n is the row index of the member to retrieve.

bullet.gif    row is the CArray at row index n.

bullet.gif    On success, a reference to a CArray is returned.

bullet.gif    On failure, nil is returned.

Remarks

Each row of the CMatrix is a reference to a CArray containing (column, value) pairs. This method returns a reference to the row at index n. Therefore, the returned row may be subjected to CArray methods.

Example

Assume that a CMatrix named M exists and contains a value "abc" at index [10][5]. This script shows working with the returned row as a CArray:

r = M:GetRow(10)

-- return a reference to row 10

if r and r:Exists(5) then

-- check that row r exists and column 5 exists

  v = r:Get( 5 )

-- get the value of M[10][5]

  Printf("v = '%s'", v )

-- v = 'abc'

end

 

Related Topics

CMatrix class, CArray, Get


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