lua-users home
lua-l archive

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


> But how to list the globals ? Is there a way to do that with a lua api function ?


  const char *name = NULL;
  lua_beginblock();
  while ((name = lua_nextvar(name)) != NULL) {
    lua_Object value = lua_getresult(2);
    ...  /* uses `name' and `value' */
    lua_endblock();
    lua_beginblock();  /* reopens a block */
  }
  lua_endblock();


-- Roberto