Thread View: borland.public.delphi.rtl.general
2 messages
2 total messages
Started by Bjorn Mossberg
Tue, 04 Mar 2008 13:34
FindFirst/FindNext Bug
Author: Bjorn Mossberg
Date: Tue, 04 Mar 2008 13:34
Date: Tue, 04 Mar 2008 13:34
28 lines
1633 bytes
1633 bytes
FindFirst and FindNext interprets the mask '*.xyz' as '*.xyz*'
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;
Re: FindFirst/FindNext Bug
Author: Craig Stuntz TeamB
Date: Tue, 04 Mar 2008 13:01
Date: Tue, 04 Mar 2008 13:01
13 lines
1519 bytes
1519 bytes
Bjorn Mossberg wrote: > 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads