ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / External file functions / WLanguage procedures
  • Caution
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
WLanguage procedure called by fWatchFile
WLanguage procedure ("callback") called by fWatchFile when a change is made to the watched file.
This can be a local, global, or internal.
Example
// Name of the file to watch
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 fWatchFile(sFileName, fWatchFile_Callback, ...
		fwCreateFile + fwModifyFile + fwDeleteFile +  ...
		fwRename) THEN
	// Notifies the user that the file will be watched
	Info("The " + sFileName + " file will be watched.")
ELSE
	// Notifies the user that the file will not be watched
	Info("The " + sFileName + " file will not be watched.")
END

// Code of the procedure
INTERNAL PROCEDURE fWatchFile_Callback(sFullName, sFileName, nAction, sOldFileName)
	sActionDesignation is string
	// The designation of the action depends on nAction
	SWITCH nAction
		CASE fwCreateFile: sActionDesignation = "Creating files"
		CASE fwDeleteFile: sActionDesignation = "Deleting files"
		CASE fwModifyFile: sActionDesignation = "Modifying files"
		CASE fwRename: 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
fWatchFile_Callback(<Full name of the watched file> , <Name of modified file> , <Action> , <Old file name>)
<Full name of the watched file>: Character string
Full path (directory and name) of the watched file.
<Name of modified file>: Character string
Name of the watched file (after changes).
<Action>: Integer constant
Action performed on the file:
fwCreateFileThe <Name of modified file> file was created.
fwDeleteFileThe <Name of modified file> file was deleted.
fwModifyFileThe <Name of modified file> file was modified.
fwRenameThe <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.
For more details on threads, see Managing threads.
Business / UI classification: Neutral code
Component: wd290std.dll
Minimum version required
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/22/2024

Send a report | Local help