Difference between revisions of "Unpack"

From GiderosMobile
(remove language stuff)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[(global)]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/(global)|(global)]]<br/>
 
  
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Returns the elements from the given table. This function is equivalent to
+
Returns the elements from the given table.
 
 
    return list[i], list[i+1], ···, list[j]
 
 
 
except that the above code can be written only for a fixed number of elements. By default, i is 1 and j is the length of the list, as defined by the length operator.</translate>
 
 
<source lang="lua">
 
<source lang="lua">
 
(multiple) = unpack(list)
 
(multiple) = unpack(list)
 
</source>
 
</source>
  
=== <translate>Parameters</translate> ===
+
This function is equivalent to
'''list''': (table) <translate>table from which to extract elements</translate> <br/>
+
return list[i], list[i+1], ···, list[j]
 +
except that the above code can be written only for a fixed number of elements. By default, i is 1 and j is the length of the list, as defined by the length operator.
 +
 
 +
=== Parameters ===
 +
'''list''': (table) table from which to extract elements<br/>
  
=== <translate>Return values</translate> ===
+
=== Return values ===
'''<translate>Returns</translate>''' (multiple) <translate>all values from table as separate values</translate><br/>
+
'''Returns''' (multiple) all values from table as separate values<br/>
  
 
{{(global)}}
 
{{(global)}}

Revision as of 06:28, 20 January 2021

Available since: Gideros 2011.6
Class: (global)

Description

Returns the elements from the given table.

(multiple) = unpack(list)

This function is equivalent to

return list[i], list[i+1], ···, list[j]

except that the above code can be written only for a fixed number of elements. By default, i is 1 and j is the length of the list, as defined by the length operator.

Parameters

list: (table) table from which to extract elements

Return values

Returns (multiple) all values from table as separate values