AttachGrid
The AttachGrid function attaches an existing grid window and returns its CGrid object to the script. This method works only if the script is run on a grid window with that grid windowbeing the top-most window. This is how the script knows which window to attach. If the top-most window is not a grid window when the script attaches it, this function will return nil. To attach the default CGrid pane that opens from the Script Editor, use DefGrid instead. To create a new, empty grid window, use NewGrid.
G = AttachGrid()
where
G is the CGrid object of the existing grid window. On failure, nil is returned.
This global function is simply a convenience wrapper around the CGrid:Attach method.
The following script attaches an open grid window (Mira report) to the script:
|
|
|
-- Attach an existing grid window |
|
-- exit with a message if not a grid window |
|
-- Returns the number of columns in the grid |
|
-- Returns the number of rows in the grid |
|
- Result: Grid: 3x50 |
|
|