I'm wanting to reverse the order of an index in a TClientDataSet, the following code looks like it should do the trick but does nothing. Is there a nice way to reverse the order of an index?
procedure TForm8.Button1Click(Sender: TObject);
var
index: TIndexDef;
begin
index := ClientDataSet1.IndexDefs.Find('LengthIndex');
if ixDescending in index.Options then
index.Options := index.Options - [ixDescending]
else
index.Options := index.Options + [ixDescending];
end;