table.insert
From GMod Wiki
Function | |
Syntax |
table.insert( Table table, [ Integer Position], Var addition ) Where is this used? |
Description: | |
Adds a value into a table, either in a specified spot or on to the end. | |
Returns: | Number index |
Part of Library: | Table |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Table.insert]Table.insert [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Additional Notes
- The inserted value may be any sort of value.
- This function has an optional 'Position' argument in between the first and second args.
- If you pass 3 arguments to table.insert, the 3rd argument will be inserted into the table specified by the first argument, at the position specified by the 2nd argument.
- If you don't pass 3 arguments to table.insert, the 2nd argument will be appended to the end of the table specified by the first argument.
- Returns which index the item gets put in.