FANDOM


unpack( tbl, [i,] [j] )
Returns the elements from the given table.
tbl
The Table
i
start index (default: 1)
j
end index (default: #tbl)

Returns the elements from the given table. This function is equivalent to

 return tbl[i], tbl[i+1], ···, tbl[j]

This can be useful for passing arguments to functions; this example will print "hello" in pink at 64,64:

 function getargs()
  return {"hello",64,64,14}
 end
 
 cls()
 args=getargs()
 print(unpack(args))
Community content is available under CC-BY-SA unless otherwise noted.