LUA Problems

BlitzMax Forums/BlitzMax Programming/LUA Problems

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi Guys
I need help with the LUA Script Module. If i load a script or create a Script with SetScriptText...
Import Pub.LuaScript

Global LuaScr:ScriptEngine = New ScriptEngine


Function Debug(ls:Byte Ptr)
        Local Text:String = LuaScr.CheckString(ls,1)
      '  Print Text 
End Function

Local Script:String = "Print2(~qtest~q)"
LuaScr.AddFunction(Debug, "Print2")
LuaScr.SetScriptText(SCript, "")


Local time:Int = MilliSecs()
For Local i:Int = 0 Until 1000
LuaScr.SetScriptText(Script, "")
LuaScr.RunScript()
Next 

Print MilliSecs()-time

LuaScr.ShutDown()



I get an error before i uncomment the SetScriptText row in the Next Loop. But it´s to slow to add the Script every loop, why i cant use "one" handle with the Script and use it forever ?
Thx
Mfg Suco