Home | Sign in | English EN
  • Caution
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
WLanguage procedure called by fTrackDirectory
WLanguage procedure ("callback") called by fTrackDirectory when a change is made to the tracked directory.
This can be a local, global, or internal.
// Name of directory to track
sDirectoryName is string = "C:\Temp\MyDir"
// The fTrackDirectory_Callback procedure will be called
// when a file or directory in the "C:\Temp\MyDir" directory is modified.  
IF fTrackDirectory(sDirectoryName, fTrackDirectory_Callback, ftCreateFile + ...
ftModifyFile + ftDeleteFile + ftRename) THEN
// Inform the user that the directory will be tracked
Info("The " + sDirectoryName + " directory will be tracked.")
// Inform the user that the directory will not be tracked
Info("The " + sDirectoryName + " directory will not be tracked.")
// Code of the procedure
PROCÉDURE fTrackDirectory_Callback(sDirectoryName, sFileName, nAction, sOldFileName)
ExecuteMainThread(AddTable,sDirectoryName, sFileName, nAction, sOldFileName)
// Procedure that acts on the main thread
PROCEDURE AddTable(sDirectoryName, sFileName, nAction, sOldFileName)
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"
// Add a line containing the information about the modification
// into the TABLE_MODIFICATIONS table
TableAddLine(TABLE_MODIFICATIONS, sDirectoryName, sFileName, , ...
sActionDesignation, sOldFileName)
fTrackDirectory_Callback(<Name of the tracked directory> , <Name of modified element> , <Action> , <Former name>)
<Name of the tracked directory>: Character string
Full name of the tracked directory.
<Name of modified element>: Character string
Name of modified file or directory.
<Action>: Integer constant
Action performed:
ftCreateFileThe <Name of modified element> file or directory was created in <Directory>.
ftDeleteFileThe <Name of modified element> file or directory was deleted from <Directory>.
ftModifyFileThe <Name of modified element> file or directory was modified in <Directory>.
ftRenameThe <Name of modified element> file or directory was renamed in <Directory>.
<Former name>: Character string
Former name of the modified file or directory if they were renamed.


This WLanguage procedure is run in a WLanguage thread.
Caution: The following processes cannot be run in the threads:
  • opening windows with WLanguage functions such as Open, Use, Close, ... A specific management mode must be implemented if some windows must be handled in threads (rare case). For more details, see Opening a window in a secondary thread.
  • managing events.
  • managing timers.
For more details on threads, see Managing threads.
Business / UI classification: Neutral code
Component: wd270std.dll
Minimum version required
  • Version 18
This page is also available for…
Click [Add] to post a comment