LuaInterface.LuaDLL.lua_istable C# (CSharp) Method

lua_istable() public static method

public static lua_istable ( IntPtr luaState, int stackPos ) : bool
luaState System.IntPtr
stackPos int
return bool
        public static bool lua_istable(IntPtr luaState, int stackPos)
        {
            return lua_type(luaState, stackPos) == LuaTypes.LUA_TTABLE;
        }

Usage Example

示例#1
0
        public static int msgHandler(IntPtr L)
        {
            if (!LuaDLL.lua_isstring(L, 1))
            {
                return(1);
            }
            LuaDLL.wlua_getglobal(L, "debug");            //msg,debug
            if (!LuaDLL.lua_istable(L, -1))
            {
                LuaDLL.lua_pop(L, 1);
                return(1);
            }
            LuaDLL.wlua_getfield(L, -1, "traceback");             //msg,debug,traceback
            if (!LuaDLL.lua_isfunction(L, -1))
            {
                LuaDLL.lua_pop(L, 2);
                return(1);
            }
            LuaStateCache cache = LuaStateCacheMan.GetLuaStateCache(L);

            LuaDLL.lua_pushvalue(L, 1);                                   //msg,debug,traceback,msg
            LuaDLL.lua_pushinteger(L, 2 + (cache.isException() ? 2 : 0)); //msg,debug,traceback,msg,level
            LuaDLL.lua_pcall(L, 2, 1, 0);                                 //msg,debug,tracebackstring
            cache.clearException();
            return(1);
        }
All Usage Examples Of LuaInterface.LuaDLL::lua_istable
LuaDLL