Hi, I ported a Delphi service to linux using FPC. The app uses FindFirst, 
FindNext and FindClose the same way Delphi Help shows:

if FindFirst(Edit1.Text, FileAttrs, sr) = 0 then
begin
  repeat
    ...
    ...
  until FindNext(sr) <> 0;
  FindClose(sr);
end;

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?.

Thanks in advance.

Leonardo M. Ramé
http://leonardorame.blogspot.com



_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to