Yet another dumb question from me, but I’m in pursuit of knowledge. I’ll get right to the point.
Example:
Raw Code
local LuaGlobals = {['assert']=assert,['collectgarbage']=collectgarbage,['error']=error,['getfenv']=getfenv,['getmetatable']=getmetatable,['ipairs']=ipairs,['loadstring']=loadstring,['newproxy']=newproxy,['next']=next,['pairs']=pairs,['pcall']=pcall,['print']=print,['rawequal']=rawequal,['rawget']=rawget,['rawset']=rawset,['select']=select,['setfenv']=setfenv,['setmetatable']=setmetatable,['tonumber']=tonumber,['tostring']=tostring,['type']=type,['unpack']=unpack,['xpcall']=xpcall,['_G']=_G,['_VERSION']=_VERSION}
So let’s say you have a table like that, for example. However, doing #LuaGlobals obviously returns 0. Is there a way that I can get all of the variables from a table?
The table is “empty”. If you do print(#LuaGlobals), the result will be 0. So that wouldn’t work. Though you can still reference variables like LuaGlobals._G.
But I’m trying to get a list of every variable “attached” to the table.