Difference between revisions of "Table.remove"

From OpenEUO
Jump to: navigation, search
(Created page with " table.remove (table [, pos]) Removes from table the element at position pos, shifting down other elements to close the space, if necessary. Returns the value of the removed ele...")
 
Line 1: Line 1:
 
  table.remove (table [, pos])
 
  table.remove (table [, pos])
  
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.  Note that the tables store values in no particular order, so be sure you really want the 'last element' removed!
+
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.  Note that an unsorted table stores values in no particular order, so be sure you really want the 'last element' removed!
 +
 
 +
[[Table.sort]]

Revision as of 18:37, 7 October 2010

table.remove (table [, pos])

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. Note that an unsorted table stores values in no particular order, so be sure you really want the 'last element' removed!

Table.sort