I am trying to code an app which interfaces with the LUA interpreter.
Everything works fine, I can execute scripts, etc, register C functions with LUA_Register, however when I try to use the laux function LUAl_register and pass a function array I get a syntax error.
Here's a rough sample code:
Code: Select all
;LUA State
global ls
; The sample procedure
ProcedureC testfunc(L)
MessageRequester("title","success!")
ProcedureReturn 0
EndProcedure
; Open the Interpreter
ls=lua_open()
;Load all the LUA Libs
luaL_openlibs(ls)
;Register the procedures for the interpreter
global dim EGPFuncs.LUA_Reg(0)
EGPFuncs(0)\name="testfunc"
; Syntax Error on the Next Line
EGPFuncs(0)\func(ls)=@testfunc()
;two null values to end the array
EGPFuncs(FSIndex)\name=""
EGPFuncs(FSIndex)\func(ls)=#Null
;Execute the sample script
LUAL_DoFile(ls, "script.lua")
;Close the interpreter
lua_close(ls)
Here's how the relevant structure, and the prototype looks like, from the wrapper:
Code: Select all
PrototypeC lua_CFunction (L)
Structure luaL_Reg
name.s
func.lua_CFunction
EndStructure
Code: Select all
EGPFuncs[] = {{"testfunc"}, {testfunc}};
Any help is appreciated.
Erion