Difference between revisions of "Getfenv"
From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Returns the current environment in use by the function. f can be a Lua function or a number that speci...") |
|||
Line 4: | Line 4: | ||
Returns the current environment in use by the function. f can be a Lua function or a number that specifies the function at that stack level: Level 1 is the function calling getfenv. If the given function is not a Lua function, or if f is 0, getfenv returns the global environment. The default for f is 1. | Returns the current environment in use by the function. f can be a Lua function or a number that specifies the function at that stack level: Level 1 is the function calling getfenv. If the given function is not a Lua function, or if f is 0, getfenv returns the global environment. The default for f is 1. | ||
<source lang="lua"> | <source lang="lua"> | ||
− | (table) | + | (table) = getfenv(f) |
</source> | </source> | ||
− | '''f | + | '''f''': (varies) function or number(call stack level) '''optional'''<br/> |
'''Returns''' (table) environment with all the defined values in environment scope<br/> | '''Returns''' (table) environment with all the defined values in environment scope<br/> |
Revision as of 10:16, 23 August 2018
Available since: Gideros 2011.6
Description
Returns the current environment in use by the function. f can be a Lua function or a number that specifies the function at that stack level: Level 1 is the function calling getfenv. If the given function is not a Lua function, or if f is 0, getfenv returns the global environment. The default for f is 1.
(table) = getfenv(f)
f: (varies) function or number(call stack level) optional
Returns (table) environment with all the defined values in environment scope