Difference between revisions of "(global)"
(select function added) |
m (Text replacement - "</source" to "</syntaxhighlight") |
||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
=== Example === | === Example === | ||
'''Prints all current global variables:''' | '''Prints all current global variables:''' | ||
− | < | + | <syntaxhighlight lang="lua"> |
local function globalVariable() | local function globalVariable() | ||
for k,v in pairs(_G) do | for k,v in pairs(_G) do | ||
Line 17: | Line 17: | ||
globalVariable() | globalVariable() | ||
− | </ | + | </syntaxhighlight> |
{|- | {|- |
Latest revision as of 18:08, 12 July 2023
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 |