> Can anyone pse explain what directory recursion means?

Im not a recusion expert but I hope the following shed some light :)

If you were searching directories for a file or building a list of all files
in a directory you would want to look first in the base folder and then each
sub folder and their subfolders etc etc until you find the file or run out
of folders to search.

The easiest way to do this (that I know of) is to use a recursive procedure.
A recursive procedure is a procedure that calls itself.  Obviously this can
cause problems (like stack overflows) if the procedure gets stuck in a loop.

example

function FindFile(FileName, Directory : String) : Boolean;
begin

//Is file in current dir

//Call FindFile for each directory in he specified directory until all have
been checked or the file is found

end;


Not a great example but I hope this illustrates simple recursion.

Rob

Software engineer
Wild Software Ltd
Ph 03 338-1407
----- Original Message -----
From: "Alistair George" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Friday, October 25, 2002 2:51 PM
Subject: [DUG]: Recursion - directories


> Can anyone pse explain what directory recursion means?
> Tks,
> Al+
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to