[fpc-pascal] FindFirst...FindClose

Michael Van Canneyt michael at freepascal.org
Mon May 18 17:25:51 CEST 2009



On Mon, 18 May 2009, Jonas Maebe wrote:

> 
> On 18 May 2009, at 16:39, Leonardo M. Ramé wrote:
> 
> >Apparently my program gets stuck after a couple (several, in fact) of calls
> >to the function that includes this code.
> >
> >By reading the FPC.RTL documentation, I found it says that FindClose must be
> >used outside the if, as follows:
> >
> >if FindFirst(Edit1.Text, FileAttrs, sr) = 0 then
> >begin
> > repeat
> >   ...
> >   ...
> >until FindNext(sr) <> 0;
> >end;
> >FindClose(sr);
> >
> >Can be this the cause of the problem in my application?.
> 
> Yes.

Huh ? Since when is this requirement ? 

If it is correct, 100% of my FindFirst/FindClose code must be rewritten !

Michael.


More information about the fpc-pascal mailing list