[fpc-pascal] FindFirst...FindClose

Jonas Maebe jonas.maebe at elis.ugent.be
Mon May 18 16:52:12 CEST 2009


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.


Jonas


More information about the fpc-pascal mailing list