Einzelnen Beitrag anzeigen

1ermehr

Registriert seit: 26. Mär 2008
9 Beiträge
 
#9

Re: probleme verzeichnisse zu suchen

  Alt 14. Mai 2008, 04:20
Ich versthehe einfach nicht warum die rekursion hier nicht funktioniert sie müsste an der richtigen stelle
sein aber wird stumpf nicht ausgeführt...

Delphi-Quellcode:
procedure findf(path: string);
var
  fts: TSearchRec;
  fcount, dcount: integer;
  buf: string;
begin
  fcount := 0;
  dcount := 0;
  findfirst(path+'\*.*', faanyfile, fts);
  if fts.Attr = faDirectory then
    inc(dcount, 1)
  else
    inc(fcount, 1);
  repeat
    if (DirectoryExists(fts.Name) and not ((fts.Name = '.') or (fts.Name = '..'))) then
     begin
      buf := path+'\'+fts.Name;
      findf(buf); // dieser aufruf wird dreist ignoriert
      form1.ListBox1.Items.add(buf);
      Application.ProcessMessages;
      if FileExists(path+'\'+fts.Name + '\' + form1.edit1.text) then form1.listbox1.Items.Add(fts.Name);
      inc(dcount, 1)
     end
    else inc(fcount, 1);
  until findnext(fts) <> 0;

  FindClose(fts);
  form1.label1.Caption := inttostr(fcount + dcount) + ' items. ' + inttostr(fcount) +
    ' files, ' + inttostr(dcount) + ' directories.';
end;
Bitte helft mir mein kopf platzt bald...
  Mit Zitat antworten Zitat