Originally Posted by Stormknight
Tables are pretty awesome.
Something that often confuses new LUA coders - table entries start with an key/index of 1.
Lua Code:
local newTable = {} table.insert(newTable,"First Line") d(newTable)
The contents of the table is a single entry, with a key of 1 (not zero, as you would expect with something like C++).
|
But if you like 0 as your first element, then you can do:
Lua Code:
table = { [0] = "firstElement", "secondElement", "thirdElement"}