type
PSRec=^TSearchRec;
function DateCompare(Item1, Item2: Pointer): Integer;
begin
if PSRec(Item1)^.Time> PSRec(Item2)^.Time then Result:=1 else
if PSRec(Item1)^.Time=PSRec(Item2)^.Time then Result:=0 else
Result:=-1;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
SRList:TList;
SR:TSearchRec;
PSR:PSRec;
begin
SRList:=TList.Create;
if F SRList.Count> 1 then SRList.Sort(DateCompare);
for i:=0 to SRList.Count-1 do
Memo1.Lines.Add(PSRec(SRList.Items[i])^.Name+' '+
DateTimeToStr(FileDateToDateTime(PSRec(SRList.Items[i])^.Time)));
SRList.Free;
end;
|