lua-users home
lua-l archive

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


hi ppl,
first of all sorry for the late reply but i was caught up in work ...... thanks for the help ..... but i am still learning Lua and hence i didn't completely understand your replies.
i will try to explain what i am doing in my program.
first i open a single lua state, which is used throughout the program,  using:

m_pLUAState = lua_open();

then i initialize other things needed and register with Lua the C++ functions that i want to export to my scripts:

lua_register(LUAPtr, FuncNAme, FuncPtr);

then i simply call a script file, which is a simple local text file, using:

lua_dofile(m_pLUAState, Filename );

now what i think happens is that each time lua_dofile is called internally lua opens the file, loads it, parses it etc etc. and then closes it upon returning.

the question that i had (if the assumption above is correct, plz verify this) is since lua already opened and loaded a file once it should not do this again if the same script was called.

is there a way to manage this in a simple and efficient manner? or prefably if lua could do this on its own end.

thanks in advance,

sohyl.

P.S. comments wuold be really helpful if you suggest some code.

 

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.