Difference between revisions of "(global)"
(language stuff) |
(select function added) |
||
Line 39: | Line 39: | ||
[[rawset]] ''non-metamethod set value of table[index], index != nil''<br/><!--GIDEROSMTD:rawset(table,key,value) non-metamethod set value of table[index], index != nil--> | [[rawset]] ''non-metamethod set value of table[index], index != nil''<br/><!--GIDEROSMTD:rawset(table,key,value) non-metamethod set value of table[index], index != nil--> | ||
[[require]] ''loads package, updates _LOADED, returns boolean''<br/><!--GIDEROSMTD:require(packagename) loads package, updates _LOADED, returns boolean--> | [[require]] ''loads package, updates _LOADED, returns boolean''<br/><!--GIDEROSMTD:require(packagename) loads package, updates _LOADED, returns boolean--> | ||
+ | [[select]] ''returns items in a list or number of items in a list''<br/><!--GIDEROSMTD:select(index,...) returns items in a list or number of items in a list--> | ||
[[setfenv]] ''sets env, f can be a function or number(stack level, default=1-, 0=global env''<br/><!--GIDEROSMTD:setfenv(f,table) sets env, f can be a function or number(stack level, default=1-, 0=global env--> | [[setfenv]] ''sets env, f can be a function or number(stack level, default=1-, 0=global env''<br/><!--GIDEROSMTD:setfenv(f,table) sets env, f can be a function or number(stack level, default=1-, 0=global env--> | ||
[[setmetatable]] ''sets metatable, nil to remove metatable''<br/><!--GIDEROSMTD:setmetatable(table,metatable) sets metatable, nil to remove metatable--> | [[setmetatable]] ''sets metatable, nil to remove metatable''<br/><!--GIDEROSMTD:setmetatable(table,metatable) sets metatable, nil to remove metatable--> |
Revision as of 22:06, 24 September 2022
Supported platforms:
Available since: Gideros 2011.6
Description
Global scope of Lua environment.
Example
Prints all current global variables:
local function globalVariable()
for k,v in pairs(_G) do
print(k,v)
end
end
globalVariable()
Methodsassert error if v nil or false, otherwise returns v |
EventsConstants |