Replies: 1 comment 2 replies
-
Lua function invocation from Java code is explained in Java API#Call Lua functions. Following that example, you will need to: try (Lua L = new Lua54()) {
L.run("function MyAdd(num1, num2) return num1 + num2 end");
LuaValue add = L.eval("return MyAdd")[0];
LuaValue i = add.call(1, 2)[0];
assertEquals(3, i.toInteger());
} I guess the documentation is not clear enough? Would you mind pointing out what aspects of the documentation confuses you so that I can improve it? Thanks! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I would like to write some code that will invoke below LUA function passing two numbers and get the result.
function MyAdd( num1, num2 )
return num1 + num2
end
Can anyone help me with that? From the documentation I don't get how to do it.
Beta Was this translation helpful? Give feedback.
All reactions