Assigning Lua tables

Posted by Artel on Sun 24 Aug 2008 12:28 AM — 3 posts, 14,897 views.

USA #0

spl_tmp_array = {}
...
spl_tmp_array[#spl_tmp_array+1] = spl_names[ i ]
Note("adding "..spl_names[ i ][1]) -- works fine, outputs in my world
Note("adding "..spl_tmp_names[#spl_tmp_array][1]) -- causes the error below


[string "Plugin"]:245: attempt to index global 'spl_tmp_names' (a nil value)


I have a table (spl_names) whose elements are also tables. In the code above, I am trying to assign one of those elements to a be a new element in a different table. As I understand it, both elements should then point to the same exact table. But, I am getting an error on the last line of the snippet, saying that it's a nil value.

Does anyone have any clues on how to fix this?
Amended on Sun 24 Aug 2008 12:29 AM by Artel
Netherlands #1
Probably because you are mixing up your tables.

You'll most likyl want to change that spl_tmp_names variable to say spl_tmp_array, like in the rest of your code. :)
USA #2
Oops...

Thanks!