Difference between revisions of "(global)"
Line 9: | Line 9: | ||
Global scope of Lua environment. | Global scope of Lua environment. | ||
+ | === <translate>Example</translate> === | ||
+ | '''Prints all current global variables:''' | ||
+ | <source lang="lua"> | ||
+ | local function globalVariable() | ||
+ | for k,v in pairs(_G) do | ||
+ | print(k,v) | ||
+ | end | ||
+ | end | ||
+ | |||
+ | globalVariable() | ||
+ | </source> | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| |
Revision as of 06:13, 13 July 2020
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 |