lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Helo

I have embeded LUA in my VC++6.0. Now I know haw to simple tabel data out by 
lua_getglobal(), lua_pushstring() and lua_gettable() via stack. But I dont
know haw to get data out if I have table inside the table.

:-)

On Tue, 29 Apr 2003 at 12:47:21, Tomas wrote:

> > Haw do I get out path or x,y,z from this table? 
> > 
> > EnemyList = {
> >     
> >     Enemy1 = {
> >         path = ".\mesh\kock4.x",
> >         x = 67,
> >         y = 57,
> >         z = 23
> >     },
> > 
> >     Enemy2 = {
> >         path = ".\mesh\kock2.x",
> >         x = 10,
> >         y = 1,
> >         z = 45
> >     }
> > }
> 	Do you mean EnemyList.Enemy1.path?  Or a generic
> way?  Something like:
> 
> function get (i, j)
> 	return EnemyList["Enemy"..i][j]
> end
> 
> get (1, 'path')
> 
> 	might give you the same result.
> 		Tomas



____________________
http://www.email.si/