/*
* Excutes a Lua file and returns all the chunk's return
* values in an array
*/
public object[] DoFile(string fileName)
{
int oldTop = LuaDLL.lua_gettop(luaState);
if (LuaDLL.luaL_loadfile(luaState, fileName) == 0)
{
executing = true;
try
{
if (LuaDLL.lua_pcall(luaState, 0, -1, 0) == 0)
{
return(translator.popValues(luaState, oldTop));
}
else
{
ThrowExceptionFromError(oldTop);
}
}
finally { executing = false; }
}
else
{
ThrowExceptionFromError(oldTop);
}
return(null); // Never reached - keeps compiler happy
}