Order an array

Order an array

Postby Silvio.Falconi » Mon Feb 24, 2020 11:21 am

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: Order an array

Postby ADutheil » Mon Feb 24, 2020 1:49 pm

Try something like this: ASORT( aData,,, { |x,y| x[3] < y[3] } )
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Order an array

Postby Silvio.Falconi » Wed Feb 26, 2020 9:31 am

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] } )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests