Why doesn't iesbNone restore the sort order?
function XCompareFilename(i1, i2: Integer): Integer;
{ Custom sort function (by Filename). }
var
s1, s2: string;
begin
s1 := ExtractFileName(Form1.Collection1.MIO.Params[i1].FileName);
s2 := ExtractFileName(Form1.Collection1.MIO.Params[i2].FileName);
if s1 < s2 then
Result := -1
else if s1 > s2 then
Result := 1
else
Result := 0;
end;
if ToggleSort1.Down then
Form1.Collection1.Sort(XCompareFilename)
else
Form1.Collection1.Sort(iesbNone);
Form1.Collection1.Update;
You should not have to store the original sort order in a stringlist to do so.
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development