CMatrixRow:Empty


The Empty method deletes all members of the CMatrixRow but does not delete the CMatrixRow object.

Syntax

CMatrixRow:Empty()

  

This deletes all array members without deleting the CMatrixRow object itself. If you delete the CMatrixRow, the object is set to nil and cannot be used again without creating a new instance using new. By calling Empty, the existing CMatrixRow can be used to Set new members, and so forth.

Example

The following script sets 3 members in a new CMatrixRow M, then deletes all members of M:

R = CMatrixRow:new()

-- create a CMatrixRow

R:Set( 127, -63.25 )

-- set member

R:Set( 100, 12.34 )

-- set member

R:Set( 4, -42 )

-- set member

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

-- result: Members = 3

R:Empty()

-- empty the array

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

-- result: Members = 0

Related Topics

CMatrixRow class