` Printed Icetips Article

Icetips Article



ABC: New sort order for a browse
1998-09-07 -- Jim Katz
 
Newsgroups: topspeed.products.c4

> I'm trying something similar. I'm using the code in the 'Solodex' example as
> a basis.
> The way its setup to work there is pretty interesting. Any use to you?

Thanks for the suggestion, but when I looked at the Solodex example I
realized that's too much like work. However using standard ABC
methods I managed to come up with a much more elegant solution. Instead
of trying to build a dynamic index I used the Browse Manager and View
manager methods to simply add a new sort order based on no key and no
step class, then I used AppendOrder to add my new sort string as the
current order and reset from file and it works like a champ. This is the
code that does the important stuff:

    NewOrder = BRW1.AddSortOrder(,)
    BRW1.ApplyOrder
    BRW1.AppendOrder(Clip(NewSortOrder))
    BRW1.ApplyOrder
    BRW1.ResetFromFile
    LOC:IndexBuilt = True
    ThisWindow.Reset()

Then in the ResetSort method embed, priority first, because I have other
tabs with conditional sorts that would override this one:

IF Choice(?CurrentTab) = 3 AND LOC:IndexBuilt AND NewOrder > 0
  RETURN SELF.SetSort(NewOrder,Force)
End

--
Jim Katz



Printed November 23, 2024, 10:15 pm
This article has been viewed/printed 35373 times.
Google search has resulted in 10 hits on this article since January 25, 2004.