Update Lua Support

This commit is contained in:
2018-06-26 22:08:36 +03:00
parent aa794d7eb1
commit 37a09bd79a
4 changed files with 93 additions and 255 deletions

View File

@@ -86,17 +86,17 @@ Src.Text:='function main(n)'+sLineBreak+' return n'+sLineBreak+'end';
//Src.RegisterFunction('','varmain');
//Src.Register('','Pmain',TypeInfo(integer));
Module:=Src.Compilate;
//Func1:=Module.Funtion['main'];
Func1:=Module.Funtion['main'];
//Func2:=Module.Funtion['varmain'];
//if 1<>Func1.Call(TypeInfo(integer),[454],CRTBCallTypeStdCall).AsInteger then
// raise Exception.Create('Error in LuaTest');
if 1<>Func1.Call(TypeInfo(integer),[454],CRTBCallTypeStdCall).AsInteger then
raise Exception.Create('Error in LuaTest');
//Var1:=Module.&Var['Pmain'];
//Var1.Val:=424;
//if Var1.Val.AsInteger<>Func2.Call(TypeInfo(integer),[],CRTBCallTypeStdCall).AsInteger then
// raise Exception.Create('Error in LuaTest');
//FreeAndNil(Var1);
//FreeAndNil(Func2);
//FreeAndNil(Func1);
FreeAndNil(Func1);
FreeAndNil(module);
FreeAndNil(Src);
FreeAndNil(Lua);