Difference between revisions of "Table.remove"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[table]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/table|table]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<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>
+
Removes from table the element at position pos, shifting down other elements to close the space if necessary.
 
<source lang="lua">
 
<source lang="lua">
 
(varies) = table.remove(table,pos)
 
(varies) = table.remove(table,pos)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
+
 
'''table''': (table) <translate>table from which to remove element</translate> <br/>
+
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.
'''pos''': (number) <translate>index at which to remove element (default is last element)</translate> '''optional'''<br/>
+
 
=== <translate>Return values</translate> ===
+
=== Parameters ===
'''<translate>Returns</translate>''' (varies) <translate>removed value</translate><br/>
+
'''table''': (table) table from which to remove element<br/>
 +
'''pos''': (number) index at which to remove element (default is last element) '''optional'''<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (varies) removed value<br/>
  
 
{{Table}}
 
{{Table}}

Revision as of 02:46, 19 March 2021

Available since: Gideros 2011.6
Class: table

Description

Removes from table the element at position pos, shifting down other elements to close the space if necessary.

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

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.

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