ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Attention : This is version 26 of this documentation page. This feature may have been changed or removed in a higher version.
This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Mobile Device (Pocket PC) access functions
  • and parameters
  • Creating directories during the copy
  • Managing the progress of the copy
  • Equivalence
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Copies one or more files:
  • from the current computer to the connected Mobile Device (Pocket PC).
  • from the connected Mobile Device (Pocket PC) to the current computer.
  • from the connected Mobile Device (Pocket PC) to another directory found on the Mobile Device (Pocket PC).
Remarks:
  • The files can be copied only if a connection is established between the current computer and the Mobile Device (Pocket PC) (ceConnect).
  • This function is available in 64-bit mode.
Example
// Copy the "Image.GIF" file found in the current directory
// from the current computer to the connected Mobile Device
// If this file already exists on the Mobile Device,
// this file is overwritten (ceOverwrite constant)
ResCopy = ceCopyFile(cePCToPocket + ceOverwrite, "Image.GIF", "\MyImages\Photo.GIF")
// Has a problem occurred?
IF ResCopy = True THEN
Info("The copy was performed.")
ELSE
Error(ErrorInfo())
END
// Copies the files found in the "\MyImages" directory
// on the Mobile Device (Pocket PC) to the current computer
// The subdirectories and their files are
// taken into account (ceRecursive constant)
ResCopy = ceCopyFile(cePocketToPC + ceRecursive, ...
"\MyImages\*.*", "C:\MyFiles\", ManageProgress)
// -- Code of the ManageProgress procedure
PROCÉDURE ManageProgress(TotalByte, TotalTransmitted)
// Displays the progress of the copy in the status bar
Message("Copy in progress: " + TotalTransmitted + " / " + TotalByte)
RESULT True
Syntax
<Result> = ceCopyFile(<Mode and type of copy> , <Source file> , <Destination file or directory> [, <WLanguage procedure>])
<Result>: Boolean
  • True if the files have been copied,
  • False otherwise. If an error occurs, you can get the details of the error with ErrorInfo.
<Mode and type of copy>: Integer constants
Mode of copy to perform:
cePCToPocketCopy from the current computer to the connected Mobile Device (Pocket PC).
cePocketToPCCopy from the connected Mobile Device (Pocket PC) to the current computer.
cePocketToPocketCopy from the connected Mobile Device to another directory found on the Mobile Device.

Type of copy to perform (optional constant):
ceOverwriteThe existing files are overwritten by the copied files.
ceRecursiveRecursive copy of the files: subdirectories and their files are also copied.

No copy option is selected by default.
<Source file>: Character string (with quotes)
Name and full path of the files to copy (up to 260 characters).
The wildcard characters (*,?) are allowed in the name of the file and in the path.
<Destination file or directory>: Character string (with quotes)
Destination file and/or directory (up to 260 characters). This parameter can correspond to:
  • the name and full path of a file.
  • a full path, only for a copy with wildcard characters.
If this parameter corresponds to a directory name, this name may (or may not) end with "\".
<WLanguage procedure>: Procedure name
Name of a WLanguage procedure automatically called to check the progress of the copy.
This procedure cannot be called if the cePocketToPocket constant is used.
Remarks

<Source file> and <Destination file or directory> parameters

If the file used corresponds to a file found on the current computer, these parameters can be:
  • the name of a file. This file will be automatically sought in the current directory (returned by fCurrentDir).
  • the name of a file with its path (full or relative). A UNC path can be used.
If the file used corresponds to a file found on the connected Mobile Device, these parameters must necessarily correspond to the name and to the full path of the file to use.

Creating directories during the copy

  • If one of the directories of the destination path does not exist, it is automatically created.
  • If the source file corresponds to all the files found in a directory ("C:\Temp\*.*" for example), the ceRecursive constant must be used to create the subdirectories in the destination (and to copy their content).

Managing the progress of the copy

To monitor the progress of the copy, ceCopyFile can automatically call the Procedure <Procedure WLanguage> at regular intervals (every 100 KB).
This procedure is declared as follows:
PROCEDURE <Procedure name>(<Total size>, <Transferred size>, <File name>)
  • <Total size> is an integer corresponding to the total size of file currently copied.
  • <Transferred size> is an integer corresponding to the number of bytes already copied.
  • <File name> is a character string corresponding to the name of the file currently copied.
In this procedure, you can:
  • display a progress bar,
  • find out whether the transfer is completed (<Total size> = <Transferred size>).
By default, ceCopyFile cannot be interrupted as long as all the files have not been copied. To force the copy to be interrupted, use the following row in the Procedure <Procedure WLanguage>:
RESULT False
In other cases (to continue the path), the Procedure <Procedure WLanguage> MUST return True.
If the Procedure <Procedure WLanguage> returns no value (neither True, nor False), an error is generated.
Reminder: This procedure cannot be called if the cePocketToPocket constant is used.

Equivalence

ceCopyFile and fCopyFile have equivalent operating modes.
The only difference is:
  • ceCopyFile handles the files found on the Mobile Device from a WINDEV application.
  • the fCopyFile function manipulates files on the Mobile Terminal only from a WINDEV Mobile application.
Component: wd260ce.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/02/2021

Send a report | Local help