Home | Sign in | English UK
  • Procedure for handling each listed file or directory
  • Interrupting ceListFile
  • Managing errors
  • Equivalence
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
ceListFile (Function)
In french: ceListeFichier
Lists the files found in a directory (and in its sub-directories) and returns the number of listed files. The directory used is found on the Mobile Device (Pocket PC) connected to the current computer.
ceListFile automatically calls a specific procedure written in WLanguage for each listed file. This procedure is used to handle the current file.
  • ceListFile can be used only if a connection is established between the current computer and the Mobile device (ceConnect).
  • Versions 20 and later
    This function is available in 64-bit mode.
    New in version 20
    This function is available in 64-bit mode.
    This function is available in 64-bit mode.
// Lists the ".BMP" files found in "\MyDocuments".
// The FileAttribute procedure returns the number of read-only files.
ResListFile = ceListFile("\MyDocuments\*.BMP", FileAttribute)
<Result> = ceListFile(<Path and Generic Name of Files> , <Procedure Name> [, <Pointer>])
<Result>: Integer
Number of listed files.
<Path and Generic Name of Files>: Character string (with quotes)
Path and generic name of files to list. The generic characters (* and?) are allowed.
<Procedure Name>: Character string (with or without quotes)
Name of WLanguage procedure ("callback") that will be called for each listed file and directory. This procedure is used to handle the current file or directory.
This procedure has the following format:
PROCEDURE <Procedure Name>(<Path>, <File Name>, <Change>,
<Procedure Pointer>)

The parameters of this procedure are optional.
There is no need to pass parameters to this procedure. Indeed, these parameters are automatically filled whenever a file is processed.
<Pointer>: Optional integer
Pointer passed to the <Procedure Name> procedure.

Procedure for handling each listed file or directory

For each file found, ceListFile automatically calls the <Procedure Name> procedure. This procedure is a local or global procedure of WINDEV.
To create this procedure:
  1. Create a global procedure ("Insert .. New global procedure" in the code editor).Create a global procedure from the code editor: on the "Code" pane, in the "Procedures" group, expand "New" and select "New global procedure".
  2. Fill the procedure declaration as follows:
    PROCEDURE <Procedure Name> (<Path>, <File Name>, <Change>,
    <Procedure Pointer>)
    • <Path> is the path of file or directory used (it always contains a "\" character at the end ; for example, "\WINDEV\").
    • <File Name> is a character string containing the name of file found, empty string ("") if <Path> corresponds to a new listed file.
    • <Change> is a constant set to:
      • ceFirstFile when the file is the first file listed in <Path>,
      • ceChangeDir when the file is the first file listed in a sub-directory of <Path> (which means that a change of directory occurred),
      • ceDirectory when <Path> corresponds to a new listed file,
      • ceFile in all the other cases.
      The different values that can be taken by <Change> are as follows:
      Current file<Change>
      Dir\File 1ceFirstFile
      Dir\File nceFile
      Dir\SubDir 1\ceDirectory
      Dir\SubDir 1\File 1ceChangeDir
      Dir\SubDir 1\File mceFile
      Dir\SubDir 2\ceDirectory
      Dir\SubDir 2\File 1ceChangeDir
      Dir\SubDir 2\File xceFile
  • <Procedure Pointer> is an integer whose value is the one passed to the <Pointer> parameter of ceListFile. If <Pointer> is not specified, <Pointer> is set to 0.
To retrieve the value of <Procedure Pointer>, the value of <Procedure Pointer> must be assigned to the value of <Pointer> in the procedure by Transfer (see the example).

Interrupting ceListFile

ceListFile cannot be interrupted as long as all files have not been browsed. To force the interruption of the browse, use the following code line in the <Procedure Name> procedure:
In this case, ceListFile returns the number of files browsed until the call to "Result False".
In any other case (to continue the browse), <Procedure Name> MUST return True.
An error is generated if <Procedure Name> returns no value (neither True nor False).

Managing errors

Caution: ceListFile returns no error code. To find out whether an error was generated by this function, use ErrorInfo associated with the errMessage constant.


The operating mode of ceListFile is equivalent to the operating mode of fListFile.
The only difference is:
  • ceListFile is using a file or a directory found on Mobile Device (Pocket PC) from a WINDEV application.
  • fListFile is using a directory found on Mobile Device (Pocket PC) from a WINDEV Mobile application.
Component : wd250ce.dll
Minimum version required
  • Version 9
This page is also available for…
Click [Add] to post a comment