a, ... = Unpack(t)
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.
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".