table.foreachi
From GMod Wiki
Revision as of 15:45, 19 November 2009 by Crazy Quebecer (Talk | contribs)
Function | |
Syntax |
table.foreachi( Table t, Function f ) Where is this used? |
Description: | |
Iterate over each numerically indexed value in t, calling f with each index and value. | |
Returns: | nil |
Part of Library: | Table |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Table.foreachi]Table.foreachi [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Additional Notes
- This function is deprecated in Lua 5, in favor of using:
for i, v in ipairs(someTable) do someFunction(i, v) end
- This function will ignore any non-numeric keys in your table.
See Also
- table.foreach
- Lua Reference Manual (section 5.4)