Hi there… I have three arrays and I have to sort the first one by the second and the third. For example, in SQL the query may be “… sort by arrayB,arrayC” but I don’t know how I can do the same thing in Xoyo
SortWith (if I understand right) do the sort of one or more arrays based on another array values…
For example:
ArrayA
(0)=1
(1)=2
(2)=3
ArrayB
(0)=2
(1)=1
(2)=1
ArrayC
(0)=3
(1)=2
(2)=1
I need to have this result
ArrayA
(0)=3
(1)=2
(2)=1
I hope explained well…
Ciao Sergio,
you can create a temp array with items that contains all the needed data to execute the sort and then sort this array WITH the others
tempArray.sortWith ArrayA, ArrayB, ArrayC
[quote=373849:@Antonio Rinaldi]Ciao Sergio,
you can create a temp array with items that contains all the needed data to execute the sort and then sort this array WITH the others
tempArray.sortWith ArrayA, ArrayB, ArrayC[/quote]
Thanks Marco. It seems a good idea, but I (thinking about my question) solved quickly creating an “in ram” database whith a table that stores all my data, then I made a select order by and I think I solved my problem with 5 code lines…