CGrid:SelectSheet


The SelectSheet method selects the current sheet from the range 1 through GetNumSheets.

Syntax

bSuccess = G:SelectSheet( nIndex )

where

    nIndex is the index of the sheet to be selected. It must be in the range 1 to GetNumSheets.

    bSuccess is the returned success code. On success it is true, otherwise false.

Example

The following script creates a CGrid and selects the current sheet:

G = NewGrid(3,10,4)

-- new grid with 3 cols, 10 rows, 4 sheets

bSuccess = G:SelectSheet( 2 )

-- Select sheet 2

Printf(" success = %d\n", bSuccess )

-- result: success = 1

bSuccess = G:SelectSheet( 5 )

-- Select sheet 5 (out of range)

Printf("success = %d\n", bSuccess )

-- result: success = 0

Related Topics

SetNumSheets

DeleteSheet

CGrid class