[Lazarus-es] Recorer archivos de una carpeta

Martin Gomez mmgomez en gmail.com
Mie Ene 22 19:33:11 CET 2014


Ten en cuenta que el ejemplo sólo hace el Write en pantalla si es una
carpeta (faDirectory), en la ayuda de Lazarus están los valores para buscar
archivos, la extensión la defines en el FindFirst, poniendo '*.doc?' (el
comodín ? es para los .docx)


On Wed, Jan 22, 2014 at 3:30 PM, Martin Gomez <mmgomez en gmail.com> wrote:

>
> 2014/1/22 Maxi <maximiliano.duarte en gmail.com>
>
>> Busca de filesearch Ahora no tengo a mano para enviarte ejemplos desde el
>> celular
>
>
> ​Es algo así como FileFindFirst y FileFindNext, utilizando en el "next" la
> estructura de búsqueda creada en el findfirst.
>> http://www.freepascal.org/docs-html/rtl/sysutils/findfirst.html
>
> aqui el ejemplo de la web:
>
> Program Example43;
> { This program demonstrates the FindFirst function }
> Uses SysUtils;
> Var Info : TSearchRec;
>     Count : Longint;
> Begin
>   Count:=0;
>   If FindFirst ('*',faAnyFile and faDirectory,Info)=0 then
>     begin
>     Repeat
>       Inc(Count);
>       With Info do
>         begin
>         If (Attr and faDirectory) = faDirectory then
>           Write('Dir : ');
>         Writeln (Name:40,Size:15);
>         end;
>     Until FindNext(info)<>0;
>     end;
>   FindClose(Info);
>   Writeln ('Finished search. Found ',Count,' matches');
> End.
>
>
> ​Lo he utilizado muchas veces y funciona de maravillas.​
>
>
> --
> Try not to become a man of success but rather to become a man of value. *Albert
> Einstein*
>



-- 
Try not to become a man of success but rather to become a man of value. *Albert
Einstein*
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus-es/attachments/20140122/473d0d48/attachment-0002.html>


More information about the Lazarus-es mailing list