procedure FindFirstNextBug;
var
found: Integer;
aMask: String;
fName: String;
aPath: String;
aList: TStringList;
fsr: TSearchRec;
begin
aPath := GetCurrentDir;
{Only *.doc files should be found, but *.docx files are also in the list!}
aMask := aPath + '\*.doc';
aList := nil;
found := FindFirst(aMask,faAnyFile XOR faDirectory,fsr);
try
aList := TStringList.Create;
while found=0 do begin
aList.Add(aPath + '\' + fsr.Name);
found := FindNext(fsr);
end;
DisplayStringList(aList); {Use your favorite display method here.}
finally
SysUtils.FindClose(fsr);
aList.Free;
end;
end;
> FindFirst and FindNext interprets the mask '*.xyz' as '*.xyz*'
"It's not a bug; it's a feature."
http://blog.excastle.com/2007/10/01/83-backward-compatibility-or-why-dpr-returns-dproj-files/
--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html