[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: How do I add a "local" using the c api
- From: "Tom Miles" <Tom@...>
- Date: Wed, 1 Apr 2009 16:13:08 +0100
> Tom Miles wrote:
> [...]
> > When I create a state, I load an associated script file. I want to
> add
> > some variables into the state the script is running in that are only
> > visible to that script. I can add globals using lua_setglobal(L,
> > "myvar"), or even lua_setfield(L, LUA_GLOBALSINDEX, "myvar"), but
> there
> > doesn't seem to be an equivelant for locals.
>
> Something that nobody's said yet which might clarify matters for you is
> this...
>
> You *cannot* add a local variable to an already compiled script. [*]
>
Thank you for that answer. Finally everything is made clear :)