• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Need help with lua tables

## 1 post in this topic

Hi, I was wondering if there any possibility in copy a lua table to another one in c++?! I mean something like this (pseudo code):
table1 = get_from_lua(name1);
table2 = get_from_lua(name2);
tablesize = get_table_size_lua(table1);
for (i;i<tablesize;i++)
{
if (table1 != lua_function)
table2[i] = table1[i];
}

I added the if clause because i wanna copy all table members except the functions. I hope its not too unclear what i mean Thanks alot Mfg Impz0r
0

##### Share on other sites
I think the LUA documentation has some info on using LUA's table's in C++:

http://www.lua.org/manual/manual.html#5.10

[edit: hmph, how do I turn that into a link?]

[edited by - blueEbola on March 29, 2003 6:57:24 PM]
0