views:

72

answers:

2

Hi all,

is there an easy way in .Net to convert Lua table to something else (XML, datatable, array etc.) I google it for few hours but i don't ask google right or there is no easy way :-)

Thanks!

+4  A: 

If your table keys and values are simple, start from this code:

for k,v in pairs(t) do
    print("<"..k..">"..tostring(v).."</"..k..">")
end
lhf
+1  A: 

If performance is not a problem, you can try and use an intermediate representation, like JSON. Have a look at JSON4Lua ( http://json.luaforge.net/ ) and Json.NET ( http://json.codeplex.com/ ). See http://www.json.org/ for other implementations.

MiKy