Some table helpers.
Tables | Some table helpers. |
Functions | |
makeReadOnly | Makes a table and all recursive tables read-only |
ropairs | The equivalent of “pairs” for a readonly table, since “pairs” won’t work. |
findInTable | Finds a value in a table. |
matrixTable | Splits a table into a number of given columns. |
function ULib.findInTable( t, check, init, last, recursive )
Finds a value in a table. As opposed to table.HasValue(), this function will only check numeric keys, and will return a number of where the value is.
t | The table to check |
check | The value to check if it exists in t. Can be any type. |
init | (Optional, defaults to 1) The value to start from. |
last | (Optional, defaults to the length of the table) The value to end at. |
recursive | (Optional, default to false) If true, it will check any subtables it comes across. |
The number of the key where check resides, false if none is found. If init > last it returns false as well.
function ULib.matrixTable( t, columns )
Splits a table into a number of given columns. Does not change original table.
t | The table to split columns, The number of columns to create |
The new table with the column being the first key and the row being the second key.
v2.10 | Initial |
Makes a table and all recursive tables read-only
function ULib.makeReadOnly( t )
The equivalent of “pairs” for a readonly table, since “pairs” won’t work.
function ULib.ropairs( t )
Finds a value in a table.
function ULib.findInTable( t, check, init, last, recursive )
Splits a table into a number of given columns.
function ULib.matrixTable( t, columns )