Ver Mensaje Individual
  #5  
Antiguo 27-10-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 18.269
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Si te basas por ejemplo en el truco 333 del ClubDelphi para borrar una estructura en arbol de forma recursiva y lo "modificas" un poco puedes obtener un procedimiento como éste que te devuelve toda la estructura a partir de un directorio.

Código Delphi [-]
 procedure ShowTree(cPath: string; out: TStrings);
 var
   search: TSearchRec;
   nFiles: integer;
   path: string;
 begin
   path := IncludeTrailingBackslash(cPath);
   nFiles := FindFirst(Path + '*.*', faAnyFile, search);
   while nFiles = 0 do begin
     if Search.Attr = faDirectory then begin
       if (Search.Name <> '.') and (Search.Name <> '..') then begin
         ShowTree(Path + Search.Name, out);
       end;
     end
     else
       out.Add(Path + Search.Name);
     nFiles := FindNext(Search);
   end;
   FindClose(Search);
 end;

Pon un memo en un formulario y un botón con el siguiente código:

Código Delphi [-]
   Memo1.Clear;
   ShowTree('c:\winnt\', Memo1.Lines);
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita