Moves or renames an existing file.
MoveFile source To destination
source, destination:sexp
If source contains wildcards or destination ends with a path separator (\), it is assumed that destination specifies an existing folder in which to move the matching files. Otherwise, destination is assumed to be the name of a destination file to create. In either case, three things can happen when an individual file is moved:
If destination does not exist, the file gets moved. This is the usual case.
If destination is an existing file, an error occurs.
If destination is a directory, an error occurs.
An error also occurs if a wildcard character that is used in source doesn't match any files. The MoveFile method stops on the first error it encounters. No attempt is made to roll back any changes made before the error occurs.
The destination argument can't contain wildcard characters.
// Create test file
Open "c:\test.dat" for Output As # 1
Close # 1
// Move to Windows Folder
MoveFile "c:\test.dat" To WinDir$ & "\test.dat"
// Trying to move it a second time will result in an error
'
// Tidy up test file
Kill WinDir$ & "\test.dat"
MoveFile conforms to the MSDOS command Move.
{Created by Sjouke Hamstra; Last updated: 20/10/2014 by James Gaite}