I want a function which adds a key (a string!) and value to a table.
Something like:
function addnewguy(nickname,name)
table.insert(guys,nickname,name)
end
Except the above doesn't seem to work.
The "pos" in table.insert (table, [pos,] value) has to be a number value i guess.
Is there another way I can do it?
table.insert position
Re: table.insert position
In a key-value pair table, simple do: guys[nickname] = name
-
- Posts: 20
- Joined: Sat Jan 29, 2011 12:05 am
Re: table.insert position
Works, thanks Iocun. : ) I feel somewhat like an idiot haha.