Page 1 of 1

Order an array

Posted: Mon Feb 24, 2020 11:21 am
by Silvio.Falconi
I have this array

Image

AaDd(atemp,{strzero(n,4),;
SP->elemento,;
SP->desc,;
SP->settore,;
nGiorni,;
aPrices[k],;
lIslock,;
aListini[k][2] } )

the user found problems to modify the price and he wish see before specific strings (col2+col4)
before all "Ombrellone" and sectors
then all "Palma" and sectors
and then all "Cabina" and sectors


I made ASORT( aData,,, { |x,y| x[3] } ) but not run ok

Re: Order an array

Posted: Mon Feb 24, 2020 1:49 pm
by ADutheil
Try something like this: ASORT( aData,,, { |x,y| x[3] < y[3] } )

Re: Order an array

Posted: Wed Feb 26, 2020 9:31 am
by Silvio.Falconi
thanks
this ordered on alphabetic order on first column
"Cabina" then "Ombrelone" then "Palma"
I found a solution with ASORT( aData,,, { |x,y| x[3] > y[3] } )