PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
This content comes from an automatic translation.
  • Procedure for handling each listed file or directory
  • Interrupting ceListFile
  • Managing errors
  • 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
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.
Remarks:
  • 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.
Example
// Lists the ".BMP" files found in "\MyDocuments".
// The FileAttribute procedure returns the number of read-only files.
ResListFile = ceListFile("\MyDocuments\*.BMP", FileAttribute)
Syntax
<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 <Procedure name>.
Remarks

Procedure for handling each listed file or directory

For each file found, the function ceListFile automatically calls the Procedure < Procedure name>. This procedure is a local or global procedure of WINDEV.
To create this procedure:
  1. 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 the <Pointer of the Procedure>, assign the value of the <Pointer of the Procedure> to the value of the <Pointer> in the Procedure with the function Transfer (see Example).

Interrupting ceListFile

As long as there are files to browse, the function ceListFile cannot be interrupted.. To force the interruption of the browse, use the following code line in the <Procedure name> procedure:
RESULT False
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.

Equivalence

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.
  • the function fListFile manipulates a directory present on the Mobile Terminal (Pocket PC) unique from a WINDEV Mobile application.
Component : wd250ce.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment