G.unpack

From GMod Wiki

Revision as of 04:52, 18 August 2011 by TylerB (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax unpack( Table table [, Number offset ] )
Where is this used?
Description:
Returns, in a variadic form, all the sequential numeric keys in the table starting at 1 or offset.
Returns: ...
Part of Library: Global Functions
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.unpack]G.unpack [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionUnpack a table
Used onNewerShared.png
Code
t = { 1, 2, 3, 4, 5, 6 , a = 12, [ 8 ] = 7 }
 
print( unpack( t ) )
Output
1	2	3	4	5	6
DescriptionUnpack a table with an offset
Used onNewerShared.png
Code
t = { "a", "b", "c", "d" }
 
print( unpack( t , 2 ) )
Output
b	c	d
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox