lua-users home
lua-l archive

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


Hallo,

vol-lua@kokezaru.net wrote:

Hi, everyone.

I've been reading this list for quite a while, silently
lurking, and have been using LUA on and off for a little
while.  I've embedded it in a few projects, however, I've
come across something which seems easy enough, however,
I've been unable to implement it.  Using luaL_loadbuffer,
I'm loading a chunk of LUA code from a string.  I need to
be able to save ('cache') this pre-compiled code so that it
may be re-executed.  How do I save the index to that code
once it's been pushed onto the stack by luaL_loadbuffer,
and how do I call this code from that index?

Thanks!


    Store it in a table with lua_settable().

--
-alex
(http://www.ventonegro.org/)