I'm looking to sort an xbrowse displaying a tree. Sorting should be by cargo contents [n] on Tree item branch. For example: suppose I wish to sort this tree by oItem:Cargo[ 2 ] and then refresh the xbrowse showing the newly ordered tree.
- Code: Select all Expand view RUN
::oTree := NIL
TREE ::oTree //::oTree is type Tlinklist
FOR i := 1 to 10
oItem := ::oTree:Add( "Item #"+cValToChar( i ) )
oItem:Cargo := { i, hb_RandomInt(), Time() }
oItem:nLevel := 1
oItem:bAction := { |o| o:SetTree( ::SubTree( o ) ), o:bAction := Nil }
EVAL( oItem:bAction, oItem )
NEXT i
ENDTREE
Can someone suggest how to sort the tree so that it is ordered by that random integer?
Thank you,
Reinaldo.