CGrid:SetNumSheets
The SetNumSheets method specifies the number of sheets in the grid. The default grid opens with 1 sheet.
bSuccess = G:SetNumSheets( nSheets )
where
nSheets is the number of sheets to set in the grid.
bSuccess is the returned success code. On success it is true, otherwise false.
After using this method to set the number of sheets, you must set the number of columns and/or rows in each new sheet. The exception to this is when using the SetDim method. When a grid is dimensioned using SetDim, the number of columns and rows is automatically set in each of the sheets.
The following script creates a grid and increases the number of sheets at a later time:
|
-- new grid with 3 cols, 10 rows, 1 Sheet |
|
-- Select Sheet 2 |
|
-- result: success = 1 |
|
-- Select Sheet 5 (out of range) |
|
-- result: success = 0 |
|
-- change to 6 sheets |
|
-- Select Sheet 5 (in range) |
|
-- result: success = 1 |