Dont't know if this was mentioned before but -5 means access denied and often occurs if the specified search path does not exist, instead of the -3 'path not found' ....
mfG Lode ----- Original Message ----- From: "Cosmin Prund" <[EMAIL PROTECTED]> To: "Delphi-Talk Discussion List" <delphi-talk@elists.org> Sent: Tuesday, July 11, 2006 3:48 PM Subject: Re: Error: -5 > I tried the following code and got no error. Maybe it's not that... > > <code> > var F:TSearchRec; > status:Integer; > begin > status := FindFirst ('&!3485', faAnyFile, F); > while status = 0 do > begin > status := FindNext (F); > end; > FindClose (F); > end. > </code> > > David J Taylor wrote: > > Cosmin Prund wrote: > > > >> Ask for more info on the error, like window caption, window style, > >> context. Use the provided info to guess rather the error is > >> externaly-produced (windows produced) or is produced directly by your > >> application, using ether ShowMessage or "raise Exception". > >> > >> The list of things to do goes on and on for ever... Provide more info > >> if you need more assistence. > >> > > > > The one place where I think there /might/ be an error is in calling > > FindFirst with a non-existant directory. This is the code, and I don't > > think it should cause the error, but who knows! > > > > status := FindFirst (filename, faAnyFile, F); > > while status = 0 do > > begin > > sl.Add (F.Name); // sl is a TStringList > > status := FindNext (F); > > end; > > FindClose (F); > > > > Any question that the FindClose shouldn't be called if the FindFirst > > fails? > > > > Thanks, > > David > > > > > > __________________________________________________ > > Delphi-Talk mailing list -> Delphi-Talk@elists.org > > http://www.elists.org/mailman/listinfo/delphi-talk > > > > > > __________________________________________________ > Delphi-Talk mailing list -> Delphi-Talk@elists.org > http://www.elists.org/mailman/listinfo/delphi-talk > __________________________________________________ Delphi-Talk mailing list -> Delphi-Talk@elists.org http://www.elists.org/mailman/listinfo/delphi-talk