lua-users home
lua-l archive

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


It was thus said that the Great Lee Shallis once stated:
> I doubt the problem is anywhere but where I create the data so I'll add
> that below
> 
> > int lua_proc_glance_grab( lua_State *L ) {
> > proc_glance_t *glance =
> > (proc_glance_t*)lua_newuserdata(L,sizeof(proc_glance_t));
> > if ( glance ) return 1;
> > luaL_setmetatable(L,PROC_GLANCE_CLASS);
> > return 1;
> > }
> >
> Any ideas based on what causes this:
> 
> > local glance = class_proc_glance.new()
> > if glance then
> > local notice = glance:init("gasp")
> >
> To spit this out:
> 
> > gasp/lua/cfg/proc.lua:7: attempt to index a userdata value (local 'glance')

  What entries exist in the metatable PROC_GLANCE_CLASS?  If you haven't
defined __index to be either a function or a table, then you'll get this
error message.

  -spc