04-06-2009 06:29 AM
Hello,
so I have got coordinates, for example A(4,5); B(3,2); C(1,9), D(4,3). I need to order them into a rising order after the last numerical character so that they stay together. I mean: B(3,2), D(4,3), A(4,5), C(1,9).
Any idea?
Thank you for every answers.
Solved! Go to Solution.
04-06-2009 06:47 AM
04-06-2009 08:05 AM
Hello Thoric,
The idea is really good it would also work, but I have to give the letters to the coordinates, and with letters (as string) I can`t make sortable arrays. Do you have an idea how to add the letters to the coordinates and then to sort them together by one of the fields?
I hope i don`t disturb you so much,
Thomas
04-06-2009 08:14 AM
Thomas,
Make a cluster of three elements: [ y, x, Letter], where y and x are the numeric coordinates and Letter is a string control with the names of the points. Put these clusters into an array and use the array sort. By putting y first in the cluster as Thoric said, you get the sort on that component.
Lynn
04-06-2009 08:16 AM
johnsold wrote:Thomas,
Make a cluster of three elements: [ y, x, Letter], where y and x are the numeric coordinates and Letter is a string control with the names of the points. Put these clusters into an array and use the array sort. By putting y first in the cluster as Thoric said, you get the sort on that component.
Lynn
.... and in the event of two Y values being the same, the tie-breaker is the second element in the cluster (X).
Ben
04-06-2009 08:18 AM
Thanks, Ben. I forgot about that when I answered, although the issue of multiplicity did occur to me when I first read the question.
Lynn
04-06-2009 08:47 AM
It works 🙂
I just wanted to thank you guys for helping me.
Have a nice day,
Thomas