lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>   lua_getglobal(L, "testArray");
>   if(!lua_istable(L,-1))
>    {
>     cout<<"\nError getting table\n";    
>     lua_close(L); 
>     exit(0);
>    }
>   tIndex=lua_gettop(L);
>   lua_gettable(L,-1);

remove the above line of code.

>   lua_pushnil(L); // first key
>   while (lua_next(L, tIndex) != 0)
>   {
>       cout<<"\n";
>       cout<<"key has type="<<lua_typename(L, lua_type(L, -2));
>       cout<<", value has type:"<<lua_typename(L, lua_type(L, -1));
>       lua_pop(L, 1); 
>   }
>  lua_close(L); 
>  system("PAUSE");       
>  return 0;
> }

-Kevin