CGrid:SetNumRows


The SetNumRows method specifies the number of rows in the current grid sheet. The number of rows may differ between sheets.

Syntax

G:SetNumRows( nRows )

where

    nRows is the number of rows to set in the current sheet.

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:SetNumRows( 6 )

-- change to 6 rows

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

-- result: rows = 6

Related Topics

SetNumCols

GetNumRows

SetDim

CGrid class