hi,
I have a lua function that returns table (contains set of strings)
the function run fine using this code:
lua_pushstring (lua, "funcname");
lua_gettable (lua, LUA_GLOBALSINDEX);
lua_pushstring(lua, "someparam");
lua_pcall (lua, 1, 1, 0);
the function returns a table. how do I read it's contents from my c++ code?
...
I have 5000 data item definition configuration which we are expecting to be designed like,
-- Name of the device
VARIABLE Name {
type=Float,
length=20,
<<few more definition here>>
}
-- The device running elapsed time since its last boot
VARIABLE BootTime {
type=Integer,
<<few more definition here>>
}
I will be...
Ok, first up, this is NOT for a class, test, or other student type activity.
I'm a scripter for a game, and am trying to implement the math library for all to use, and unfortunately, all I have available to me is very basic lua. The implemented version cannot be changed, and does not include any libraries. For those wondering, its for ...
Hi,
I'm relatively new to Python and would like to know if I'm reinventing a wheel or do things in a non-pythonic way - read wrong.
I'm rewriting some parser originally written in Lua. There is one function which accepts a field name from imported table and its value, does some actions on value and stores it in target dictionary under ...
I have created a lua table in C, but i'm not sure how to push that table onto the top of a stack so I can pass it to a lua function.
Does anyone know how to do this?
This is my current code:
lua_createtable(state, libraries.size(), 0);
int table_index = lua_gettop(state);
for (int i = 0; i < libraries.size(); i++)
{
lua_pushstring...
There is only one public library for binding Lua to Ada I have found (http://coreland.ath.cx/code/lua-ada), but how can it be used on a Windows platform? What do I need to use in my ada-project to get lua.ads.adb libraries defined in project-files working properly?
I tried to put lua sources in my ada-project directory befory compiling ...
Hi to all.
I've made a simple Lua-execution in Ada, it cooly run everything I need via Lua.Load_Buffer("os.execute('wxlua.exe wx.lua')") but I don't need win32 cmd.exe-window, which is default opens on program's start-up. Is there any way to control this event directly from Ada?
P.S. os.execute() sends commands directly to Windows, not...
I recently stumbled into this this C++/Lua error
int function_for_lua( lua_State* L )
{
std::string s("Trouble coming!");
/* ... */
return luaL_error(L,"something went wrong");
}
The error is that luaL_error use longjmp, so the stack is never unwound and s is never destructed, leaking memory. There are a few more Lua API's th...
I am using the Corona Gaming Addition SDK to build an iphone / andorid game. I have a space ship on the screen and I will allow the user to rotate the ship 360 degrees. I would like to then call the applyLinearImpulse method to allow the user to thrust the ship forward in the direction the ship is facing.
The method accepts these argume...
What are the key steps and tools it takes to creating a 3d video game.
For example, I understand that a 3d artist will create 3d models in 3d Studio Max, or Maya, but where do these models go from there?
Are the 3d models first animated by a 3d animator in 3d Studio Max/Maya?
Then do these models along with the animation loops get sen...
Basically I'm reading the contents of a file using fstream then converting it to const char* type. I'm supplying this to Lua, and Lua will do something with this. This however does not work. What does work is if I do:
const char* data = "print('Hello world')";
luaL_pushstring(L, data);
luaL_setglobal(L, "z");
They both are in the t...
Something like this:
function foo()
print( __func__ )
...
end
How can it be done?
...
Hello,
I need a build tool for compiling,testing, reporting and the deployment of Lua programs.
I chose Maven 2 because of our Polarion version supports it.
Unfortunately, I couldn't find any Maven plugins/archetypes for Lua.
As I am a newbie in Maven I want to know whether it is difficult to write a customized Lua plugin for Maven.
...
Hi all,
Trying to write a Lua script for Scite (something like lua-users wiki: Scite Comment Box), and when I write the following piece of code:
fchars = string.sub(line, 1, 3)
if fchars == "//" or fchars == "##"
print "got it"
end
... the compilation fails with "attempt to call a string value".
I have tried different variant...
i am a new programmer and started with lua . i want to do the function that array a -b , the following are my program, it didn't work well
function delTwo (a ,b)
local i = 0
local lengthA = #a
local lengthB = #b
for i = 1 ,lengthA do
for j =1 , lengthB do
if a[i]==b[j] then
a[i] = nil
end
end
for i = 1 , le...
I'm writing a basic scripting system using lua in C++. One of my glue functions is...
lua_register(luaVM, "openFile", l_dial.l_specifyF);
The function is as follows.
static int l_specifyF(lua_State* luaVM) {
const char* c = lua_tostring(luaVM, -1);
cDialogManager::getSingletonPtr()->clearVector();
try{
luaL_dofile...
hello,
i am currently trying to figure out ways to run lua scripts using fastCGI with either lighttpd or nginx. the only thing i was able to dig up yet was wsapi of the kepler project. but i wonder, if there are other possibilities. important for me is:
should be as lightweight as possible
should be stable enough to use in a productio...
As I know, the tracing GC can't avoid thread blocking during complete GC.
I had used XNA+C#, and GC time impossible to remove. So I switched to lower level language C, but I realized I need scripting language. I'm considering Lua, but I'm worrying about Lua's GC mechanism. Lua is using incremental tracing GC, and thread blocking should ...
Any advantage on stack-less python implentation than Lua's coroutine?
What's the difference of them?
...
I'm trying to create ANTLR parser for Lua. So i took grammar produced by Nicolai Mainero(available at ANTLR's site, Lua 5.1 grammar) and begin to work.
Grammar is good. One thing not working: LONG STRINGS.
Lua specification rule: Literal
strings can also be defined using a
long format enclosed by long brackets.
We define an op...