Name
Unpack -- unpack a table (V2.0)
Synopsis
a, ... = Unpack(t)
Function
This function unpacks the table specified by t and returns all of its elements. Unpack() returns as many values as there are elements in the table.

To pack parameters into a table, use the Pack() function.

Inputs
t
table to unpack
Results
a
first value
...
additional return values depending on how much elements there are in the table
Example
a, b, c = Unpack({1, 2, 3})
The above code unpacks the specified table. a will get the value 1, b will be assigned 2 and c will receive the value 3.


a = {1, 2, 3, 4, 5, 6}
Print(Unpack(a))
This will print "1 2 3 4 5 6".

Show TOC