FileCopy Statement

Copies the file.

Syntax

FileCopy source, destination

The FileCopy statement syntax contains the following parts:

Элемент Описание
source Required. A string indicating the name of the file to be copied. Path may include folder and disk name.
destination Required. A string that specifies the name of the resulting file. Path may include folder and disk name.

Remarks

An attempt to copy an open file with FileCopy will generate an error.

Example

In this example FileCopy is used to create a copy of a file. Assume that the file SRCFILE exists and is not empty.

Dim SourceFile, DestinationFile

SourceFile = "SRCFILE" ' Source File.
DestinationFile = "DESTFILE" ' Destination File.
FileCopy SourceFile, DestinationFile ' File Copy.

 

See Also

Kill Statement, Name Statement