lua-users home
lua-l archive

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


> 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 :)