Difference between revisions of "Debug.setlocal"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === This function assigns the value value to the local variable with index local of the function at level...")
 
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
+
<languages />
=== Description ===
+
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
This function assigns the value value to the local variable with index local of the function at level level of the stack. The function returns nil if there is no local variable with the given index, and raises an error when called with a level out of range. (You can call getinfo to check whether the level is valid.) Otherwise, it returns the name of the local variable.
+
'''<translate>Class</translate>:''' [[Special:MyLanguage/debug|debug]]<br/>
<source lang="lua">
+
=== <translate>Description</translate> ===
(string), = debug.setlocal(levellocalvalue,)
+
<translate>This function assigns the value value to the local variable with index local of the function at level level of the stack. The function returns nil if there is no local variable with the given index, and raises an error when called with a level out of range. (You can call getinfo to check whether the level is valid.) Otherwise, it returns the name of the local variable.</translate>
</source>
+
<syntaxhighlight lang="lua">
'''level:''' (number) level of the stack ''''''<br/>
+
(string) = debug.setlocal(level,local,value)
'''local:''' (number) index of the variable ''''''<br/>
+
</syntaxhighlight>
'''value:''' (varies) value of the variable to set ''''''<br/>
+
=== <translate>Parameters</translate> ===
'''Returns''' (string) name of the variable or nil<br/>
+
'''level''': (number) <translate>level of the stack</translate> <br/>
 +
'''local''': (number) <translate>index of the variable</translate> <br/>
 +
'''value''': (varies) <translate>value of the variable to set</translate> <br/>
 +
=== <translate>Return values</translate> ===
 +
'''<translate>Returns</translate>''' (string) <translate>name of the variable or nil</translate><br/>
 +
 
 +
{{Debug}}

Latest revision as of 14:27, 13 July 2023


Available since: Gideros 2011.6
Class: debug

Description

This function assigns the value value to the local variable with index local of the function at level level of the stack. The function returns nil if there is no local variable with the given index, and raises an error when called with a level out of range. (You can call getinfo to check whether the level is valid.) Otherwise, it returns the name of the local variable.

(string) = debug.setlocal(level,local,value)

Parameters

level: (number) level of the stack
local: (number) index of the variable
value: (varies) value of the variable to set

Return values

Returns (string) name of the variable or nil