Difference between revisions of "(global)"
Line 47: | Line 47: | ||
[[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--> | ||
+ | [[setsafeenv]] ''sets a safe env''<br/><!--GIDEROSMTD:setsafeenv(f,table) sets a safe env--> | ||
[[tonumber]] ''convert to number, returns number, nil if non-convertible, 2<=base<=36''<br/><!--GIDEROSMTD:tonumber(e,base) convert to number, returns number, nil if non-convertible, 2<=base<=36--> | [[tonumber]] ''convert to number, returns number, nil if non-convertible, 2<=base<=36''<br/><!--GIDEROSMTD:tonumber(e,base) convert to number, returns number, nil if non-convertible, 2<=base<=36--> | ||
[[tostring]] ''convert to string, returns string''<br/><!--GIDEROSMTD:tostring(e) convert to string, returns string--> | [[tostring]] ''convert to string, returns string''<br/><!--GIDEROSMTD:tostring(e) convert to string, returns string--> |
Revision as of 17:12, 2 February 2025
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 |