Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2013-11

CopyFile in Windows

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Richard Mace

Hi,
I am getting a compile error in Lazarus 1.0.12 FPC 2.6.2 running on Windows XP:

Error: Wrong number of parameters specified for call to "CopyFile"

When I am using the syntax
CopyFile(SourceFile,DestFile);

Both SourceFile and DestFile are strings.

Any ideas, as as far as I can see, at least one of the "CopyFile"s only requires the 2 parameters?

Thanks in advance

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131111/1dd3b340/attachment.html>

Reply by email

Jürgen Hestermann
to Richard Mace
Richard Mace wrote 6 lines
Hi, I am getting a compile error in Lazarus 1.0.12 FPC 2.6.2 running on Windows XP: Error: Wrong number of parameters specified for call to "CopyFile"When I am using the syntax CopyFile(SourceFile,DestFile); Both SourceFile and DestFile are strings. Any ideas, as as far as I can see, at least one of the "CopyFile"s only requires the 2 parameters?

Propably you have included the windows unit
which defines a CopyFile routine with 3 parameters: http://msdn.microsoft.com/en-us/library/windows/desktop/aa363851%28v=vs.85%29.aspx

So either you remove the windows unit or, if not possible, you need to fully qualify from which unit you want to call CopyFile (I don't know where it's defined). -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131111/96e22d6e/attachment.html>

Reply by email

Luca Olivetti
to Jürgen Hestermann

Al 11/11/13 18:14, En/na J?rgen Hestermann ha escrit:

So either you remove the windows unit or, if not possible, you need to fully qualify from which unit you want to call CopyFile (I don't know where it's defined).

in FileUtil.
Note that, differently than the windows CopyFile function (which returns an error code), FileUtil.CopyFile will throw an exception in case of error.

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007

Reply by email

Richard Mace
to Luca Olivetti: Al 11/11/13 18:14, En/na J?rgen Hestermann ha escrit: in FileUtil. Note that, differently…

Spot on. Can't believe I missed that.

Thanks

Luca Olivetti wrote 23 lines
Al 11/11/13 18:14, En/na J?rgen Hestermann ha escrit: > > So either you remove the windows unit or, if not possible, > you need to fully qualify from which unit you want to call CopyFile (I > don't know where it's defined). in FileUtil. Note that, differently than the windows CopyFile function (which returns an error code), FileUtil.CopyFile will throw an exception in case of error. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007 -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20131112/27bfb7d0/attachment.html>

Reply by email