by Marc Venken » Tue Nov 26, 2024 11:10 am
Mr. Rao,
You look a different way...
My dbf field will hold data like this (sizes)
cData = "XL,S,M,2X,3X" // or any combination like ( "S,L,M")
Make a array from cData (I can)
aArray1 := { "XL", "S", "M", "2X", "3X" }
aOrder := { "XS" ,"S", "M", "L", "XL" , "2X" , "3X", "4X" } // All posible options AND also in the order I would like them.
ASort( aArray1, , , { |x, y| AScan(aOrder, x) < AScan(aOrder, y) } )
Result =
aArray1 := { "S", "M", "XL", "2X", "3X" }
// save result back to dbf with correct functions.. (=ok)
I was not able to use the correct aSort, because I did not know the correct codeblock.
This is working for my project.
Thanks for looking into it
Marc Venken
Using: FWH 23.04 with Harbour