Herzlich willkommen in der Delphi-PRAXiS, grebaldi.
SR solltest du nur auslesen:
Delphi-Quellcode:
procedure ListDir(const Path: string; FileList: TStrings; ext: Boolean);
var
SR: TSearchRec;
begin
Assert(Assigned(FileList), 'Gotcha!'); // EDIT
if FindFirst(IncludeTrailingPathDelimiter(Path) + '*.*', faAnyFile, sr) = 0 then
begin
repeat
if ((sr.Attr and faDirectory) <> faDirectory)
and (sr.Name <> '.')
and (sr.Name <> '..')
and ({StrUtils.}AnsiIndexText(ExtractFileExt(sr.Name), ['.avi', '.mpg', '.mpeg']) >= 0) then
if ext
then FileList.Append(ChangeFileExt(sr.Name, '')) // EDIT
else FileList.Append(sr.Name);
until FindNext(sr) <> 0;
FindClose(sr);
end;
end;
Freundliche Grüße