LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Sort table rows by date

I've got a date field in my table which isn't in standard format (it's a string). Is it possible to adjust the function SortTableCells to make my own sort rules?
Image Hosted by ImageShack.us
0 Kudos
Message 1 of 3
(3,270 Views)
SortTableCells relies on other functions to do the comparison. The second to last parameter you pass to SortTableCells is a pointer to the function.
From userint.h:
int CVIFUNC SortTableCells (int panel, int control, Rect cellRange, int direction, int keyIndex,
int descending, CellCompareCallbackPtr comparisonFunction,
void *callbackData);
Look at the colview.prj sample project that ships with CVI. It defines a function SortByDate and then tells SortTableCells to call that function. You can create your own comparison function that reads and compares your date format.
Message 2 of 3
(3,270 Views)
Thanks!
Image Hosted by ImageShack.us
0 Kudos
Message 3 of 3
(3,270 Views)