Module cl_tables

Table functions

Functions

NextFree (tbl) NextFree function.
TableLength (tbl) TableLength function.
TableContains (tbl, value) TableContains function.
TableHighest (tbl) TableHighest function.
TableContainsTypes (tbl, types) TableContainsTypes function.


Functions

NextFree (tbl)
NextFree function. This function returns the next free number in a table.

Parameters:

  • tbl The table. table

Returns:

    number

Usage:

    local num = exports.jones_util:NextFree({
    	[1] = "test",
    	[2] = "test",
    	[4] = "test"
    })
    # returns 3
TableLength (tbl)
TableLength function. This function returns the length of a table.

Parameters:

  • tbl The table. table

Returns:

    number

Usage:

    local length = exports.jones_util:TableLength(tbl)
TableContains (tbl, value)
TableContains function. This function returns if a table contains a value.

Parameters:

  • tbl The table. table
  • value The value. any

Returns:

    boolean

Usage:

    local contains = exports.jones_util:TableContains(tbl, "test")
TableHighest (tbl)
TableHighest function. This function returns the highest number in a table.

Parameters:

  • tbl The table. table

Returns:

    number

Usage:

    local highest = exports.jones_util:TableHighest(tbl)
TableContainsTypes (tbl, types)
TableContainsTypes function. This function checks if a table contains a values with a specific types.

Parameters:

  • tbl The table.
  • types The types in an equal table.

Returns:

    boolean

Usage:

    local contains = exports.jones_util:TableContainsTypes(tbl, {["test"] = "string"})
generated by LDoc 1.5.0 Last updated 2024-05-13 19:05:24