CGridView:ToTable


The ToTable method creates a 2-dimensional table containing the cell values from the grid. Each row of the returned table contains a 1-dimensional table of data from the columns of that row. Also see the inverse operation, FromTable. This method returns the contents of the range of cells contianing data. For example, if a table has 200 rows and 50 columns, but only the first 8 rows and 23 columns contain data, then the returned table will have 8 rows of 23 columns each. You can determine the maximum column and row numbers containing data using the GetMaxCol and GetMaxRow methods.

Syntax

lua_table = CGridView:ToTable()

bullet.gif    The returned lua_table is a 2-dimensional table containing the cell values of the table, organized in row order.

bullet.gif    On failure, nil is returned.

Example

The following script returns the entire grid contents as a 2-dimensional table:

G = new_gridview("My Grid")

-- create CGridView with default properties

tbl = G:ToTable()

-- returns a table containing the cell data.

list(tbl)

-- list the values of the table.

Related Topics

CGridView class

FromTable

GetRect

GetMaxCol

GetMaxRow


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.