CGrid:GetNumRows


The GetNumRows method returns the number of rows in the current grid sheet. The number of rows may differ between sheets.

Syntax

nRows = G:GetNumRows()

where

    nRows is the number of rows in the current sheet. On failure, 0 is returned.

Example

The following script creates a grid and increases the number of rows at a later time:

G = NewGrid(3,10)

-- new grid with 3 cols, 10 rows, 1 sheet

Printf("rows = %d\n", G:GetNumRows() )

-- result: Rows = 10

G:SelectSheet( 3 )

-- Select Sheet 3 (out of range)

Printf("rows = %d\n", G:GetNumRows() )

-- result: Rows = 0 (sheet out of range)

G:GetNumRows( 6 )

-- change to 6 rows

Printf("rows = %d\n", G:GetNumRows() )

-- result: Rows = 6

Related Topics

GetNumCols

SetNumRows

CGrid class