Module sv_tables

Table functions

Functions

NextFree (tbl) NextFree function.
TableLength (tbl) TableLength function.
PrintTable (tbl) PrintTable 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.

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.

Returns:

    number

Usage:

    local length = exports.jones_util:TableLength({
    	[1] = "test",
    	[2] = "test",
    	[3] = "test"
    })
    # returns 3
PrintTable (tbl)
PrintTable function. This function prints a table to the console.

Parameters:

  • tbl The table.

Usage:

    exports.jones_util:PrintTable(tbl)
TableContains (tbl, value)
TableContains function. This function checks if a table contains a value.

Parameters:

  • tbl The table.
  • value The value.

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.

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, message

Usage:

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