Would this work to get the number of values of a table inside a table
table.getn(Table[1])
That would get the total number entries inside any table positioned at the first index of an array named “Table”.
1 Like
local tables = {
{"a", "b", "c", "d"},
{1, 2, 3, 4},
{true, false, true, false},
{0.1, 0.2, 0.3, 0.4}
}
print(table.getn(tables[1]))
--output is 4 as expected
never mind I figured it out sorry everyone
local ExampleDict = {
["field1"] = {"1", "2", "3" },
["field2"] = {"4", "5", "6" }
}
print(ExampleDict["field"][1])
Slightly different indexing required when working with dictionaries. But with your previous example, the way you did it was fine.
1 Like