Ver Mensaje Individual
  #1  
Antiguo 21-05-2015
shoulder shoulder is offline
Miembro
 
Registrado: abr 2008
Posts: 441
Reputación: 17
shoulder Va por buen camino
Ordenar Archivos Directorio en Listbox

Hola no me doy cuenta como ordenar por fecha de creacion en un listbox los archivos de directorio. Copio lo que fui haciendo y encontrando, funciona bien pero no ordena. Gracias.
Código Delphi [-]
if DirectoryExists(carpeta) then
   ListBox1.Items := ListaArchivos(carpeta+'*.pdf');
Código Delphi [-]
 function ListaArchivos(directorioPadre: string) : TStringList;
  var
    sr: TSearchRec;
  begin
    Result := TStringList.Create;
    if FindFirst(directorioPadre + '*', faAnyFile, sr) = 0 then
      repeat
        if (sr.Attr and faDirectory = 0) or (sr.Name <> '.')
          and (sr.Name <> '..') then
            Result.Add( sr.Name);
      until FindNext(sr) <> 0;
    FindClose(sr);
  end;

Última edición por nlsgarcia fecha: 21-05-2015 a las 18:56:55. Razón: Sintaxis Delphi
Responder Con Cita