PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Copying a directory and its sub-directories
  • Copying the directory selected by the user
fCopyDir (Example)
Copying a directory and its sub-directories
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC) The following code is used to copy a directory. The sub-directories are also copied (frRecursive constant).
// Declare the variables
DirectoryToCopy is string
CopiedDirectory is string
ResCopy is boolean
// Select the directory to copy
DirectoryToCopy = "C:\DirectoryA"
// Select the copied directory
CopiedDirectory = "C:\DirectoryB"
// Copy the directory
ResCopy = fCopyDir(DirectoryToCopy, CopiedDirectory, frRecursive)
// Display an error message if the copy failed
IF ResCopy = False THEN
Error(ErrorInfo(errMessage))
ELSE
Info("The directories have been copied")
END
Copying the directory selected by the user
WINDEVReports and QueriesUser code (UMC) The following code is used to copy a directory. The directory to copy and the copied directory are selected by fSelectDir. A progress window is displayed (frProgress constant).
// Declare the variables
DirectoryToCopy is string
CopiedDirectory is string
ResCopy is boolean
// Select the directory to copy
DirectoryToCopy = fSelectDir("", "Select the directory to copy")
// Select the copied directory
CopiedDirectory = fSelectDir("", "Select the copied directory")
// Copy the directory
ResCopy = fCopyDir(DirectoryToCopy, CopiedDirectory, frProgress)
// Display an error message if the copy failed
IF ResCopy = False THEN
Error(ErrorInfo(errMessage))
ELSE
Info("The directory was copied")
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment