NewGrid


The NewGrid method creates a new grid window and returns a CGrid object. To attach the default CGrid pane that opens from the Script Editor, call DefGrid instead. To attach an existing grid window, use AttachGrid.

Syntax

G = NewGrid( nCols )

G = NewGrid( nCols, nRows )

G = NewGrid( nCols, nRows, nSheets )

G = NewGrid( CGrid2 )

where

    nCols is the number of columns to set in each sheet.

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

    nSheets is the number of sheets to set.CGrid2 is an existing CGrid object that will be copied to the new CGrid.

    G is a new CGrid object.

  

This global function is simply a convenience wrapper around the CGrid:new() method. Creating a CGrid either way gives the same result.

Example

The following script creates a new grid and sets the grid size to 4 columns x 10 rows with 1 sheet:

 

G = NewGrid( 4, 10 )

-- Create a new grid window containing a CGrid object

Related Topics

DefGrid

AttachGrid

new

CGrid class