Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sort 2-Dim Array other than on 1st elem in row (eg for Date)
#3
Thanks!

I made my 'other column' sortfunction like this (where I intend to sort on the 3rd column):

Function DateColumnSort
Code:
Copy      Help
;/
function# param str&a str&b

&a=&a+(3*sizeof(a))
&b=&b+(3*sizeof(b))
ret StrCompare(b a)

Then I call it as such (for a descending (most recent first) date sort on the values in zero-order column 2 (3rd column):

Code:
Copy      Help
ARRAY(str) arrGrid ;; filled with dates in zero-order column 2 (3rd column)
str d
arrGrid.sort(1|0x100 DateColumnSort  &d )

It seems to be working!
Thanks so much,
S


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)