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
Message
From: "Cosmin Prund" <pcosmin (AT) adicomsoft (DOT) ro>
To: "Delphi-Talk Discussion List" <delphi-talk (AT) elists (DOT) 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 (AT) elists (DOT) org
>
>
>
Delphi-Talk mailing list -Delphi-Talk (AT) elists (DOT) org
Delphi-Talk mailing list -Delphi-Talk (AT) elists (DOT) org