I am using LuaJava and C Code for Lua. What I'm trying to do is read the Lua source stored as a String resource in an Android application so that the Lua source code can be executed. I need to know how to do this using LuaJava or C.
I want to know how I can create a Lua module in Lua using String.
In other words, I save the Lua source, which will be stored in the .lua file in String. Then I want to load the contents of this line into Lua as an available module that can be called.
I see that there is a loadstring() function, but not sure how it will be called for LuaJava or C.
I do not want Lua to look for the file system for this file, I will find the file and convert it to a string. After I have the line, I need to know how to load a line copy of the contents of the file in Lua as a module that I can call.
I also want to know if, after calling loadstring(s) , if the module remains available for subsequent function calls without reloading loadstring() again.
source share