The line
  >  GetDir(0,F.Name); // then change to it

needs to be
  >  ChDir(F.Name);  // then change to it


Wes

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Carl Reynolds
> Sent: Monday, 24 January 2000 10:49
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Delete *.*
> 
> 
> Actually it should be
> 
> while ftd = 0 do begin
> 
> Cheers,
> Carl
> 
> -----Original Message-----
> From: Jim Zheng [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 24 January 2000 8:29
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Delete *.*
> 
> 
> >while not ftd = 0 do begin
> 
> should be 
> 
> while not (ftd = 0) do begin
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of gajo
> Sent: Sunday, January 22, 1995 2:30
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Delete *.*
> 
> 
> My date is set on 1995 so that I would use a shareware program that has
> expired..
> 
> OK, I wrote down the code like this, but it doesn't work. Where's the
> problem?
> 
> procedure TForm1.DelDir(Dirname: string);
> var
>  F: TSearchRec;
>  ftd: Integer;
> begin
> ftd := FindFirst(Dirname,faAnyFile,F);
> while not ftd = 0 do begin     // while there is a file do the following
> 
> if F.Attr = (faAnyFile - faDirectory) then begin  // if file's not a
> directory
>  if F.Name = '.' then else
>  if F.Name = '..' then else
>  DeleteFile(F.Name);            // then delete it
>  end;
> if F.Attr = faDirectory then begin    // if it's a directory
>  GetDir(0,F.Name);                    // then change to it
>  DelDir(Dirname+'\'+F.Name);          // use my DelDir on that dir
>  end;
> ftd := FindNext(F);                   // FindNext
> end;
> FindClose(F);            // the end
> end;
> 
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> 
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> 
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to