PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Special cases
  • WLanguage procedure
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
Triggers the tracking of a file. In case of file modification, a specific procedure is run in a thread.
Example
// Name of file to track
sFileName is string = "C:\Temp\MyDir\MyFile.extension"
// The ProcessModification procedure will be called when the
// "C:\Temp\MyDir\MyFile.extension" file is modified.
IF fTrackFile(sFileName, ProcessModification, ...
ftCreateFile + ftModifyFile + ftDeleteFile +  ...
ftRename) THEN
// Inform the user that the file will be tracked
Info("The " + sFileName + " file will be tracked.")
ELSE
// Inform the user that the file will not be tracked
Info("The " + sFileName + " file will not be tracked.")
END

// Code of the procedure
PROCÉDURE ProcessModification(sFullName, sFileName, nAction, sFormerFileName)
sActionDesignation is string
// The designation of the action depends on nAction
SWITCH nAction
CASE ftCreateFile: sActionDesignation = "Creating files"
CASE ftDeleteFile: sActionDesignation = "Deleting files"
CASE ftModifyFile: sActionDesignation = "Modifying files"
CASE ftRename: sActionDesignation = "Renaming files"
END
// Add a line containing the information about the modification
// into the TABLE_MODIFICATIONS table
TableAddLine(TABLE_MODIFICATIONS, sFullName, sFileName, ...
sActionDesignation, sFormerFileName)
Syntax
<Result> = fTrackFile(<File Name> , <Procedure Name> [, <Modifications to Notify>])
<Result>: Boolean
  • True if the tracking of the file is enabled,
  • False otherwise. To find out the error details, use ErrorInfo.
<File Name>: Character string (with quotes)
Full name of the file to track.
<Procedure Name>: Character string (with or without quotes)
Name of the WLanguage procedure ("callback" procedure) that will be called when a change is detected in the specified file.
This procedure has the following format:
PROCEDURE <Procedure Name>([<Full Name of Modified File>
[ <, <Name of Modified File> [, <Action> [, <Former File Name>]]]])
where:
  • <Full Name of Modified File>: character string indicating the full path of the tracked file.
  • <Name of Modified File>: character string indicating the name of the tracked file (after modification).
  • <Action>: Integer constant that can take the following values:
    ftCreateFileThe <Name of Modified File> file was created.
    ftModifyFileThe <Name of Modified File> file was modified.
    ftRenameThe <Name of Modified File> file was renamed.
    ftDeleteFileThe <Name of Modified File> file was deleted.
  • <Former Name>: Former name of the modified file if the action performed is a rename operation.
Versions 22 and later
Note: This procedure can be an internal procedure.
New in version 22
Note: This procedure can be an internal procedure.
Note: This procedure can be an internal procedure.
<Modifications to Notify>: Optional Integer constant (or combination of constants)
Modifications performed in the file to track and for which the procedure must be run:
ftCreateFileThe <Name of Modified File> file was created.
ftModifyFileThe <Name of Modified File> file was modified.
ftRenameThe <Name of Modified File> file was renamed.
ftDeleteFileThe <Name of Modified File> file was deleted.
ftAllAll the possible actions will be tracked. Corresponds to ftCreateFile + ftModifyFile + ftRename + ftDeleteFile.
Remarks

Special cases

  • To stop tracking the file, use fTrackStop and fTrackStopAll.
  • To track the modifications performed on the content of a directory, use fTrackDirectory.
  • Limitations:
    • Only 5 files can be tracked at the same time.
    • You cannot track a file found at the root of a disk (for performance reasons).

WLanguage procedure

The WLanguage procedure is run in a WLanguage thread.
Caution: The following processes cannot be run in the threads:
See Managing threads for more details.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment