Hi, im pretty new to lua. Just coded an addon but im having trouble with the sorting function.
I have a table built like this :
Code:
PlayerDB = { name, class, level }
PlayerDB.name = { "name1", "name2", "name3" }
PlayerDB.class = { "Hunter", "Priest", "Mage" }
PlayerDB.level = { "30", "20", "10" }
now, if i use the table.sort function on PlayerDB.level, the values get sorted in-place of the current values. name and class though will remain unsorted.
Basically, what im trying to figure out, is if there is a way of table.sort returning me the sorting order (what original index is now index 1,2,3). So that i can then sort the other fields accordingly.
Or is my only option to code my own sorting function ?