concat

concatenates strings from a table. (V1)

SYNOPSIS

   s = table.concat(tab[, sep[, i[, j]]])

DESCRIPTION

   Concatenates strings and numbers from table 'tab' including separator
   'sep' between each two consecutive elements. Elements of indexes 'i' to
   'j' are concatenated. The default value for separator 'sep' is an empty
   string. The default value of start index 'i' is 1 (the first element).
   The default value of end index 'j' is the last element. For 'i' being
   higher than 'j' an empty string is returned

INPUTS

   tab - a table.
   sep - separator for entries.
   i - index of the first element.
   j - index of the last element

RESULT

   String

insert

inserst an element into table. (V1)

SYNOPSIS

   table.insert(t[, pos], x)

DESCRIPTION

   Inserts element 'x' into table 't' at position 'pos'. If 'pos' is not
   specified, element 'x' is inserted at the end of table

INPUTS

   t - table.
   pos - insert position.
   x - element to insert

RESULT

   None

maxn

returns maximum positive integer table index. (V1)

SYNOPSIS

   i = table.maxn(t)

DESCRIPTION

   Traverses the table 't' and finds maximum numeric positive index of an
   element. If the table has no numeric positive indices, the function
   returns 0

INPUTS

   t - table

RESULT

   Maximum positive numeric index found

NOTES

   The function traverses table linearly, so it may take some time for big
   tables.

remove

removes element from table. (V1)

SYNOPSIS

   v = table.remove(t[, pos])

DESCRIPTION

   Removes element from table 't' indexed by 'pos' and returns its value. If
   'pos' is not specified, it defaults to the length of the table, so the
   last element is removed

INPUTS

   t - table.
   pos - position of removed element

RESULT

   Value of removed element

sort

table sort based of elements values. (V1)

SYNOPSIS

   table.sort(t[, f])

DESCRIPTION

   Sorts table 't' according to element values using quicksort algorithm.
   Function 'f' is a comparision function f(a, b), which takes two values of
   the table elements and returns boolean 'true' if a < b. If 'f' is not
   specified, Lua uses its '<' operator.

   The function may throw an exception if the compare function 'f' is
   constructed in a way not giving linear order for values in 't

INPUTS

   t - table to be sorted.
   f - optional compare function

RESULT

   None

NOTES

   The algorithm used may alter positions in a group of equal elements.