User Tools

Site Tools


addons:using_libs:tableex

Tableex Library

The tableex library exposes more functions to the built-in Lua table library.

The following functions are exposed by this library:

table table.copy(t);

  • Parameters
    • t - Creates a deep copy of the given table.
  • Returns
    • The copied table.

table table.count(t);

  • Parameters
    • t - The table to count.
  • Returns
    • The number of entries in the given table.

boolean table.haskey(t, key);

  • Parameters
    • t - The table to look within.
    • key - The key to look for.
  • Returns
    • True if found, false otherwise.

boolean table.hasvalue(t, val);

  • Parameters
    • t - The table to look within.
    • val - The value to look for.
  • Returns
    • True if found, false otherwise.

table table.merge(src, dest);

  • Parameters
    • src - The source table to merge.
    • desc - The destination table to merge into.
  • Returns
    • The new table.

table table.Nil(t);

  • Parameters
    • t - The table to nil out.
  • Returns
    • The nil'd table.

table table.reverse(t);

  • Parameters
    • t - The table to reverse.
  • Returns
    • The reversed table.

table table.sortbykey(t, desc);

  • Parameters
    • t - The table to sort.
    • desc - Boolean to sort descending or not.
  • Returns
    • The sorted table.

number table.sum(t);

  • Parameters
    • t - The table to get the sum of.
  • Returns
    • The sum of the values in the table.

number table.mult(t);

  • Parameters
    • t - The table to get the sum of.
  • Returns
    • The sum of the values in the table.

number table.min(t);

  • Parameters
    • t - The table to get the minimum value of.
  • Returns
    • The minimum value.

number table.max(t);

  • Parameters
    • t - The table to get the maximum value of.
  • Returns
    • The maximum value.
addons/using_libs/tableex.txt · Last modified: 2015/11/19 23:46 by atom0s