Difference between revisions of "Table.remove"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
Removes from table the element at position pos, shifting down other elements to close the space, if necessary. Returns the value of the removed element. The default value for pos is n, where n is the length of the table, so that a call table.remove(t) removes the last element of table t.
+
<translate>Removes from table the element at position pos, shifting down other elements to close the space, if necessary. Returns the value of the removed element. The default value for pos is n, where n is the length of the table, so that a call table.remove(t) removes the last element of table t.</translate>
 
<source lang="lua">
 
<source lang="lua">
 
(varies) = table.remove(table,pos)
 
(varies) = table.remove(table,pos)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''table''': (table) table from which to remove element <br/>
+
'''table''': (table) <translate>table from which to remove element</translate> <br/>
'''pos''': (number) index at which to remove element (default is last element) '''optional'''<br/>
+
'''pos''': (number) <translate>index at which to remove element (default is last element)</translate> '''optional'''<br/>
 
=== Return values ===
 
=== Return values ===
'''Returns''' (varies) removed value<br/>
+
'''Returns''' (varies) <translate>removed value</translate><br/>

Revision as of 14:38, 23 August 2018

Available since: Gideros 2011.6

Description

Removes from table the element at position pos, shifting down other elements to close the space, if necessary. Returns the value of the removed element. The default value for pos is n, where n is the length of the table, so that a call table.remove(t) removes the last element of table t.

(varies) = table.remove(table,pos)

Parameters

table: (table) table from which to remove element
pos: (number) index at which to remove element (default is last element) optional

Return values

Returns (varies) removed value