I had great help with my last question, so I’m back for more please.
I been reading tutorials on sorting tables (http://www.lua.org/pil/19.3.html) but I can’t make my use case work.
I have two sets of variables
time_n (where n is a number assigned at time of dynamic creation)
name_n (where n is a number assigned at time of dynamic creation)
time_1 is related to name_1 in that they are referring to the same item the user has inputted
What I have been trying to do is sort though the times, to list the times in numerical order with the related name as well.
Some example data
time_1 = 10 time_2 = 5 time_3 = 45 name_1 = cascade name_2 = Centennial name_3 = Pacifica
The resulting list should appear like
pacifica 45 cascade 10 centennial 5
When I sort I need to keep the key reference of the times the same, so I can then refer to the name. I have tried putting my key,value pair into another table, but I’m getting very lost.
Can anyone suggest some methods for achieving this please.