05-03-2020 12:58 AM
Hello,
I am trying to create a list of 10 Name and their corresponding scores. I also need to sort those names alphabetically.
I have started by using one Numeric array for the Scores and a String array for the Names. But my problem starts when the sorted Names do not marry up with their now sorted scores
Is there any way of linking the 2 arrays so that the values of the indexes in the numeric array, follow names they were initially with once the.
I hope it to look like this:
Unsorted Sorted
Peter: 90 David: 65
David: 65 Lisa: 99
Lisa: 99 Peter: 90
Zak: 40 Zak: 40
Any tips or direction will be appreciated!
Solved! Go to Solution.
05-03-2020 01:01 AM - edited 05-03-2020 01:09 AM
Create an array of clusters, where each cluster contains a name and a score. Then use "sort array". LabVIEW will sort in cluster order, of if the name is the first cluster element, it will primarily sort by that.
There are many examples in the forum, one of the simplest is here. (... and it can be further simplified ;))
05-04-2020 06:33 AM
Worked a treat! Thanks.