Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Need help with lua tables

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Impz0r   Members   

166
Like
Likes
Like

Posted 29 March 2003 - 11:43 AM

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


#2 blueEbola   Members   

464
Like
Likes
Like

Posted 29 March 2003 - 11:56 AM

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]




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.