lua-users home
lua-l archive

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


(from memory)

_G['Tablename'] = {}

P.

----- Original Message -----
From: "Jimmie Houchin" <jhouchin@cableone.net>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Monday, January 08, 2007 5:12 PM
Subject: Dynamic table creation

Hello,

I am parsing XML data using LuaExpat.

I am wanting to traverse the lxp.lom.parse() tables and recreate the objects using the string from the tag as the name of the new table.

So basically how do I do something like:

'TableName' = {}

and be valid Lua?

I guess basically it this, how can I make a string become the name of the variable?

If this is an FAQ my apologies. I did not find it in my search.

Any help greatly appreciated.

Jimmie