data.clearGrid
Description
Clears an empty 2D array (grid) of all data and sets the rows and columns counts to 0.

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

Return value
none

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

-- add 2 cells to start of first row
data.setCell(cells, 0, 0, "Hello")
data.setCell(cells, 1, 0, "World")

-- print the values
print("Cells before clearing values:")
data.printCell(cells, 0, 0)
data.printCell(cells, 1, 0)

-- clear all cells
data.clearGrid(cells)

-- print the values again
print("Cells after clearing values:")
data.printCell(cells, 0, 0)
data.printCell(cells, 1, 0)


Comments

See also
data.createGrid
data.getCell
data.setCell

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