data.getCell
Description
Get a cell string value within a 2D array (grid) returned from data.loadCsvFile or data.runSelectQuery etc.

Parameters
grid 2D array (in format cells[yRow][xCol])
xCol integer (one-based X/column index)
yRow integer (one-based Y/row index)

Return value
cellValue string (returns empty string if cell is invalid or empty)

Example
-- get location names from Stock Tracker database
local cells = data.runSelectQuery("SELECT [LocationName] from [ItemLocations]")

-- get the first location name
local locationName = data.getCell(cells, 0,0)

print(locationName)

Comments

See also
data.setCell
data.printCell

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