FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Order an array
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Order an array
Posted: Mon Feb 24, 2020 11:21 AM
I have this array



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 March-April 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
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: Order an array
Posted: Mon Feb 24, 2020 01:49 PM

Try something like this: ASORT( aData,,, { |x,y| x[3] < y[3] } )

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Order an array
Posted: Wed Feb 26, 2020 09: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 March-April 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

Continue the discussion