data.getGridRowsCount
Description
Get the number rows (records) in a 2D array (grid).

Parameters
grid 2D array (in format cells[yRow][xCol])

Return value
rowsCount integer

Example
-- create empty grid
local cells = data.createGrid()

-- add 2 cell values to grid (grid is automatically resized to 5 cols by 10 rows)
data.setCell(cells, 3, 9, "Hello")
data.setCell(cells, 4, 9, "World")

-- get and print rows count
local rowsCount = data.getGridRowsCount(cells)
print("Rows count: " .. rowsCount)

Comments
If using a grid returned by data.loadCsv the first row may contain column header names.

See also
data.getGridColsCount

Back
Generated on the 26 June 2024 at 22:01:28 (UK Time)