View Single Post
06-18-12, 07:03 PM   #10
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Billtopia View Post
something on unpack that I didn't see above is for nils is in order for it to properly unpack the table all the values should be assigned at one time like the following

local temp = { nil, 1, nil, nil, nil, "blah", whatever }

if they are assigned separately it would not unpack right but as a single declaration the following would work fine

local var1, var2, var3, var4, var5, var6, var7 = unpack( temp )
See my post above showing code for a custom function I made called tAppend().
The second and third paragraphs of my post preceding that also describes exactly what you said and a workaround for it.

Note calling tAppend(table,nil) will produce an undefined result, the list of values needs to end with a non-nil value.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 06-18-12 at 07:11 PM.
  Reply With Quote