Difference between revisions of "Debug.setupvalue"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
Line 7: Line 7:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
(string) = debug.setupvalue(func,up,value)
 
(string) = debug.setupvalue(func,up,value)
</source>
+
</syntaxhighlight>
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</translate> ===
 
'''func''': (function) <translate>function to set the upvalue for</translate> <br/>
 
'''func''': (function) <translate>function to set the upvalue for</translate> <br/>

Latest revision as of 15:26, 13 July 2023


Available since: Gideros 2011.6
Class: debug

Description

This function assigns the value value to the upvalue with index up of the function func. The function returns nil if there is no upvalue with the given index. Otherwise, it returns the name of the upvalue.

(string) = debug.setupvalue(func,up,value)

Parameters

func: (function) function to set the upvalue for
up: (number) index of the upvalue
value: (varies) value to set as upvalue

Return values

Returns (string) name of the upvalue or nil