Difference between revisions of "Table.insert"

From GiderosMobile
Line 12: Line 12:
 
'''pos''': (number) <translate>index where to insert new element</translate> '''optional'''<br/>
 
'''pos''': (number) <translate>index where to insert new element</translate> '''optional'''<br/>
 
'''value''': (any) <translate>value to insert in table</translate> '''optional'''<br/>
 
'''value''': (any) <translate>value to insert in table</translate> '''optional'''<br/>
 +
 +
{{Table}}

Revision as of 22:10, 11 February 2020


Available since: Gideros 2011.6
Class: table

Description

Inserts element value at position pos in table, shifting up other elements to open space, if necessary. The default value for pos is n+1, where n is the length of the table, so that a call table.insert(t,x) inserts x at the end of table t.

 table.insert(table,pos,value)

Parameters

table: (table) table where to insert new element
pos: (number) index where to insert new element optional
value: (any) value to insert in table optional