Global/unpack

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
 
Line 28: Line 28:
 
|Description=Prints a vararg
 
|Description=Prints a vararg
 
|Code=print( unpack({"a", "b", "c"}) )
 
|Code=print( unpack({"a", "b", "c"}) )
 +
|OutputFixedWidth=Fixed width
 
|Output=a b c
 
|Output=a b c
 
}}
 
}}

Latest revision as of 15:31, 27 September 2019

 unpack( )

Contents

Description

This function takes a numeric indexed table and return all the members as a vararg. If specified, it will start at the given index and end at end index.

Arguments

table tbl

The table to generate the vararg from.

Arguments

number startIndex=1

Which index to start from. Optional.

Arguments

number endIndex=#tbl

Which index to end at. Optional, even if you set StartIndex.

Returns

vararg

Output values

Examples

Example

Prints a vararg

print( unpack({"a", "b", "c"}) )

Output:

a b c
Personal tools
Navigation