[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Simple example using Lua as a "config file" alternative?
- From: "Grellier, Thierry" <t-grellier@...>
- Date: Wed, 4 Oct 2006 11:32:13 +0200
So one would have to do something like:
lua_dostring(L, "local pushed = a.b.c[1].d");
lua_to<mytype>(L, -1);
lua_pop(L, 1);
and eventually catch error? (what if b is nil for example?)
It is just that my configuration shall be a valid lua expression, so I
don't really feel like I shall tokenize and interpret it myself.
-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Richard Simes
Sent: Wednesday, October 04, 2006 11:25 AM
To: Lua list
Subject: Re: Simple example using Lua as a "config file" alternative?
Sorry about all the grammar and spelling errors in my previous post...
> Would it be possible to do something like lua_dostring("a.b.c[1].d") ?
I'm not sure what you mean?
a.b.c[1].d
doesn't really 'do' anything?
If you're asking whether my system allows you to read fields from
other tables like this:
button.height=3
button.width=5
Then no, but that would be a useful addition (and necessary if I where
to package this up)
You would have to settle for a config file like:
buttonheight = 3
buttonwidth = 5
Richard