This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
gargoyle575's profile picture

Different way to insert data to a table?

Started by gargoyle575, 06 May 2014 - 09:46 PM
gargoyle575 #1
Posted 06 May 2014 - 11:46 PM
Is there a way to insert data into a table without table.insert? If I insert data into the middle of table, it pushes all the data after it up, and I want to avoid that. Reason being I have a master computer that will be connected to other computers. Everytime the sub-computers turn on the first thing they do is a transmit a message to "register" themselves with the master computer. All it does is take the sender channel and the message to use as the key and value, respectively.
Lyqyd #2
Posted 07 May 2014 - 03:04 AM
You can set the value of a table simply by assigning a new value to the index you wish to change:


myTable[key] = value
gargoyle575 #3
Posted 07 May 2014 - 03:55 AM
I always overlook the obvious, thanks.