Difference between revisions of "Debug.setlocal"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
+
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
=== Description ===
+
=== <translate>Description</translate> ===
 
<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>
 
<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 lang="lua">
 
<source lang="lua">
 
(string) = debug.setlocal(level,local,value)
 
(string) = debug.setlocal(level,local,value)
 
</source>
 
</source>
=== Parameters ===
+
=== <translate>Parameters</translate> ===
 
'''level''': (number) <translate>level of the stack</translate> <br/>
 
'''level''': (number) <translate>level of the stack</translate> <br/>
 
'''local''': (number) <translate>index of the variable</translate> <br/>
 
'''local''': (number) <translate>index of the variable</translate> <br/>
 
'''value''': (varies) <translate>value of the variable to set</translate> <br/>
 
'''value''': (varies) <translate>value of the variable to set</translate> <br/>
=== Return values ===
+
=== <translate>Return values</translate> ===
'''Returns''' (string) <translate>name of the variable or nil</translate><br/>
+
'''<translate>Returns</translate>''' (string) <translate>name of the variable or nil</translate><br/>

Revision as of 07:28, 24 August 2018

Available since: Gideros 2011.6

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