table.remove

From GMod Wiki

Revision as of 13:40, 2 August 2011 by TheFreeman193 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax table.remove( Table table, [ Number ID ] )
Where is this used?
Description:
Removes and returns the nth item in a table. If no number is given will remove the last item. It will also shift the remaining items up or down to reflect the new table.
Returns: Var The item taken out
Part of Library: Table
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Table.remove]Table.remove [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionDemonstrates the use of table.remove
Used onNewerShared.png
Code
local x = { "a", "pie", "delta", "money" }
table.remove( x, 2 )
Msg( x ) -- { "a", "delta", "money" }
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox