lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


You have a few options, but basically you just index the table and
make an assignment.
I'll show examples below:

-- create a new table
t = {"cat", "dog", 1, 2}

t[5] = "hello" -- adds a new string at index 5

t["key"] = "value" -- adds a value with a string key

or, a shorthand of this is:

t.key = "value"


Hope this helps,
Richard