PDA

View Full Version : Sorting Methods



daboo
06-14-2002, 05:54 PM
Hello Spoon,

It looks as though you are using MS Visual C++ to code dBPowerAMP, Here is a snippet of code for a simple sort method (I wrote this in Borland C++ Builder). What I did was set up a bunch of secondary indexes when I created the database, and then just referenced them. Works well associating with the OnTitleClick Event.

void __fastcall TMainForm::Button2Click(TObject *Sender)
{
// Sort By
if (SortBy->Text=="Status")
{
Report->Table1->IndexName="status-1";
Report->SortBy->Text="Sort By: Status";
}
if (SortBy->Text=="Section")
{
Report->Table1->IndexName="sec-row-lot-grv";
Report->SortBy->Text="Sort By: Section";
}
if (SortBy->Text=="Site *")
{
Report->Table1->IndexName="grvno-c";
Report->SortBy->Text="Sort By: Site *";
}
// End Sort By

You may also like to take a look at:
http://www.quasidata.com, they have a nice grid component that allows for maximum re-arranging flexibility.

Hope this helps.

Later,
Daboo

Spoon
06-16-2002, 05:23 AM
Ta