I need some help with unpack. my goal is to get a specific table element. once i find that element i want to get the values associated to it in the table. my problem lies on the unpack statement i want the line print("It should print right here",unpack(vectors[detail])) here is a link to pastern code http://www.pastebin.com/twM2Y0iU Please help me. i am going crazy trying to figure this out.
Unpack
Started by Rougeminner, Jan 25 2015 04:31 PM
2 replies to this topic
#1
Posted 25 January 2015 - 04:31 PM
#2
Posted 25 January 2015 - 04:46 PM
In your pastebin you are "calling" unpack with
So your code formatted properly:
unpack { vectors[detail] }
I'm pretty sure you want to do this:unpack( vectors[detail] )because what you are doing is putting your table into another table, and unpack one layer, which is as if you would write:
vectors[detail]which will be your table/3d-vector containing you 3 dimension values parsed before
So your code formatted properly:
Spoiler
#3
Posted 25 January 2015 - 05:43 PM
Another way to do it would be the following:
vector[detail] = {15, 12, 7}
print("your string", vector[detail][1], vector[detail][2], vector[detail][3])
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











