Thema: Delphi Listview schläft ein

Einzelnen Beitrag anzeigen

MathiasSimmack
(Gast)

n/a Beiträge
 
#10

Re: Listview schläft ein

  Alt 22. Jun 2004, 13:15
Also, das try/finally kannst du dir hier schon mal sparen:
Zitat von HomerGER:
Delphi-Quellcode:
    if FindFirst(laufwerk_s + '*.*', faAnyFile, SR) = 0 then
        try
            repeat
                if (SR.Attr and faDirectory = faDirectory) then
                begin
                    if ((SR.Name <> '.') and (SR.Name <> '..')) then
                    begin
                        Dateien_Suchen_GU(filelist_sl, laufwerk_s + SR.Name, mask_s);
                    end;
                end;
            until FindNext(SR) <> 0;
        finally
        FindClose(SR);
    end;
Nötig wäre das IMHO nur wenn du die API-Kommandos direkt verwendest. Bei Borlands Variante aus der "SysUtils"-Unit ist das aber nicht erforderlich. Da genügt ein simples:
Delphi-Quellcode:
if FindFirst(...) = 0 then
repeat
  { ... }
until FindNext(SR) <> 0;
FindClose(SR);
  Mit Zitat antworten Zitat