Garry's Mod Wiki

table.FindNext

  any table.FindNext( table tbl, any value )

Description

We advise against using this. It may be changed or removed in a future update. Instead, iterate the table using ipairs or increment from the previous index using next. Non-numerically indexed tables are not ordered.

Returns the value positioned after the supplied value in a table. If it isn't found then the first element in the table is returned

Arguments

1 table tbl
Table to search
2 any value
Value to return element after

Returns

1 any
Found element

Example

Print the next element after the "b" value of the table

local tbl = {"a", "b", "c"} print(table.FindNext(tbl, "b"))
Output: c in console