Setfenv

From GiderosMobile
Revision as of 10:04, 23 August 2018 by Hgy29 (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Sets the environment to be used by the given function. f can be a Lua function or a number that specif...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2011.6

Description

Sets the environment to be used by the given function. f can be a Lua function or a number that specifies the function at that stack level: Level 1 is the function calling setfenv. setfenv returns the given function.


As a special case, when f is 0 setfenv changes the environment of the running thread. In this case, setfenv returns no values.
(varies), = setfenv(ftable,)

'f: (varies) function or number(call stack level) '
'table: (table) environment table to set '
Returns (varies) returns provided function or nil