[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Inserting a key and value into a dictionary
- From: "Richard Simes" <ricardo.nz@...>
- Date: Thu, 18 May 2006 00:08:07 +1200
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