table.FindNext

From Garry's Mod
Revision as of 16:08, 14 May 2018 by Zaros (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
 table.FindNext( )

Contents

Description

This feature is deprecated.
You should avoid using it as it may be removed in a future version.

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

table tbl

Table to search

Arguments

any value

Value to return element after

Returns

any

Found element

Examples

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
Personal tools
Navigation