OK.. I have tried various examples I found found within the forums.
with this code :
Local luaVM:Byte Ptr = lua_open( )
luaopen_base(luaVM)
luaopen_table(luaVM)
luaopen_io(luaVM)
luaopen_string(luaVM)
luaopen_math(luaVM)
lua_register(LuaVM,"AddMan",AddMan)
lua_dofile(luaVM,"MyScript3.lua".ToCString())
Function AddMan(luaVM:Byte Ptr)
Print String.FromCString(lua_tostring(luaVM,-1))
lua_pushnumber(luaVM,0)
Return 1
EndFunction
lua_close(luaVM)
I get Compile Error : Unable to convert from 'Byte Ptr' to CString
on the line
lua_dofile(luaVM,"MyScript3.lua".ToCString())
with this code
Global scriptEnv:ScriptEngine=New ScriptEngine
scriptEnv.reset()
Function LUA_MyFunction( luaState:Byte Ptr )
' Let's return a string
scriptEnv.ReturnStringToLua(luaState, "Hello, World!")
Return 1 ' Returning one variable
End Function
scriptEnv.addFunction(LUA_MyFunction,"MyFunction")
scriptEnv.RunScriptFile("MyScript.lua")
ScriptEnv.Shutdown()
It compiles but then when I run it I get
Unhandled Exception: Unhandled Memory Exception Error
on the
scriptEnv.RunScriptFile("MyScript.lua")
line
So... No one else is getting these problems so what the heck have I got wrong ?
I have the latest verison of BlitzMax which I uninstalled / deleted the BlitzMax folder and reinstalled. I synchronised Modules.
If someone has any hints as to what might be causing my problem I would be very grateful.
Thanx
with this code :
Local luaVM:Byte Ptr = lua_open( )
luaopen_base(luaVM)
luaopen_table(luaVM)
luaopen_io(luaVM)
luaopen_string(luaVM)
luaopen_math(luaVM)
lua_register(LuaVM,"AddMan",AddMan)
lua_dofile(luaVM,"MyScript3.lua".ToCString())
Function AddMan(luaVM:Byte Ptr)
Print String.FromCString(lua_tostring(luaVM,-1))
lua_pushnumber(luaVM,0)
Return 1
EndFunction
lua_close(luaVM)
I get Compile Error : Unable to convert from 'Byte Ptr' to CString
on the line
lua_dofile(luaVM,"MyScript3.lua".ToCString())
with this code
Global scriptEnv:ScriptEngine=New ScriptEngine
scriptEnv.reset()
Function LUA_MyFunction( luaState:Byte Ptr )
' Let's return a string
scriptEnv.ReturnStringToLua(luaState, "Hello, World!")
Return 1 ' Returning one variable
End Function
scriptEnv.addFunction(LUA_MyFunction,"MyFunction")
scriptEnv.RunScriptFile("MyScript.lua")
ScriptEnv.Shutdown()
It compiles but then when I run it I get
Unhandled Exception: Unhandled Memory Exception Error
on the
scriptEnv.RunScriptFile("MyScript.lua")
line
So... No one else is getting these problems so what the heck have I got wrong ?
I have the latest verison of BlitzMax which I uninstalled / deleted the BlitzMax folder and reinstalled. I synchronised Modules.
If someone has any hints as to what might be causing my problem I would be very grateful.
Thanx