Done! Thank you!


At 14:53 8/12/2005, you wrote:


On Thu, 8 Dec 2005, Arí Ricardo Ody wrote:

> Why the attached program issues access violation in the call of procedure
> LoadDirFiles?
>
> I try to remove the TStringList parameter and the violation persists...
>
> May someone give me an explanation?

You must create the stringlist first, before you can use it:

  Writeln ('1');
  xxx:=Ttringlist.Create;
  Try
    LoadDirFiles (NomeDir,xxx,x);
    Writeln ('2');
    if not x then
       begin;
         Writeln ('Erro na chamada');
         Halt;
       end;
  finally
    xxx.free;
  end

And free it at the end.

That should do it.

Also, change your FIndFirst call so it actually uses the directory name:

  FileHandle := FindFirst (Dirname+'*.*',faAnyFile,Dir);


Michael.

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to