|
|
|
|
WLanguage procedure called by fTrackFile WLanguage procedure ("callback") called by fTrackFile when a change is made to the tracked file. This can be a local, global, or internal. // 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, fTrackFile_Callback, ... 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 INTERNAL PROCEDURE fTrackFile_Callback(sFullName, 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" END // Add a line containing the information about the modification // in the TABLE_MODIFICATIONS control TableAddLine(TABLE_MODIFICATIONS, sFullName, sFileName, ... sActionDesignation, sOldFileName) END
Syntax
fTrackFile_Callback(<Full name of the tracked file> , <Name of modified file> , <Action> , <Old file name>)
<Full name of the tracked file>: Character string Full path (directory and name) of the tracked file. <Name of modified file>: Character string Name of tracked file (after modification). <Action>: Integer constant Action performed on the file:
| | ftCreateFile | The <Name of modified file> file was created. | ftDeleteFile | The <Name of modified file> file was deleted. | ftModifyFile | The <Name of modified file> file was modified. | ftRename | The <Name of modified file> file was renamed. |
<Old file name>: Character string Former name of the modified file if it was renamed. Remarks Caution 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.
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|