PipeSort

TECH TIP: Using a JITPipeilne to Display Sorted Data

Question: “I am using JITpipeline and I want to know is there a way to sort the data?”

Answer: You can implement this functionality by creating an index for your data.

A simple index can be made using a StringList. You can iterate through your data and for each row add an entry
to the stringlist. Each entry will contain the string value to sort and the row index.

myIndex := TStringList.Create;

for liRow := 0 to RowCount-1 do
  myIndex.AddObject(StringValueToSort, TObject(liRow));

Once you load the data, then you can sort the StringList:

myIndex.Sort;

Now you have an index in which each item in the stringlist contains a pointer to the correct row.

To get the data for the first row:

liRowIndex := Integer(myIndex.Object[0]);