FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse , autosort
Posts: 142
Joined: Sun Oct 09, 2005 10:59 AM
Xbrowse , autosort
Posted: Thu Feb 10, 2011 10:21 AM

Hello,

Clicking on a header , the array is sorted with the data from this colum.

In some cases i want to add a second key , or column , like we can do in a index expression.

I tryed to add a new data to TXBrwColumn (bOrder) , but it seems to be too complicated.

How can it be done without changing the source from xbrowse or too add new data ?

Frank Demont

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse , autosort
Posted: Thu Feb 10, 2011 11:58 AM

1. In case of browsing RDD / TDataBase

(a) If you already have an index on the required expression, assign the index tag name to oCol:cSortOrder := <indexTagName>.

(b) If no index exists on the required expression, you may create a temporary index like
INDEX ON <expression> TAG <temptag> TO <temp> MEMORY
and assign
oCol:cSortOrder := <temptag>
oCol:cOrdBag := <temp>

2. In case of browsing RecordSet :

Just assign the two column names like:
oCol:cSortOrder := "FIRST,LAST,CITY"

3. In case of browsing Array:

You need to have your own custom sort function, which returns 'A' if sorted on ascending order or 'D' if sorted on descending order and then assign your function as codeblock to oCol:cSortOrder := { |oCol| <yourfunction> }

Regards



G. N. Rao.

Hyderabad, India
Posts: 142
Joined: Sun Oct 09, 2005 10:59 AM
Re: Xbrowse , autosort
Posted: Thu Feb 10, 2011 12:22 PM

Thanks very much , very easy to implement !!!!!

Frank

Continue the discussion