AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de archivos externos / Procedimientos WLanguage
  • Caution
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
WLanguage procedure called by fWatchDirectory
WLanguage procedure ("callback") called by fWatchDirectory when a change is made to the watched directory.
This can be a local, global, or internal.
Ejemplo
// Name of the directory to be watched
sDirectoryName is string = "C:\Temp\MyDir"
// The fWatchDirectory_Callback procedure will be called 
// when a file or directory in the "C:\Temp\MyDir" directory is modified.  
IF fWatchDirectory(sDirectoryName, fWatchDirectory_Callback, fwCreateFile + ...
		fwModifyFile + fwDeleteFile + fwRename) THEN
	// Notifies the user that the directory will be watched
	Info("The " + sDirectoryName + " directory will be watched.")
ELSE
	// Notifies the user that the directory will not be watched
	Info("The " + sDirectoryName + " directory will not be watched.")
END
// Code of the procedure
PROCEDURE fWatchDirectory_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 fsFileCreation: sDesignationAction = "File creation".
	CASE fsDeleteFile: sDesignationAction = "Delete file".
	CASE fsFileModification: sDesignationAction = "File modification".
	CASE fsRename: sDesignationAction = "Rename file".
END
// Add a line containing the information about the modification
// into the TABLE_MODIFICATIONS table
TableAddLine(TABLE_MODIFICATIONS, sDirectoryName, sFileName, , ...
		sActionDesignation, sOldFileName)
Sintaxis
fWatchDirectory_Callback(<Name of the watched directory> , <Name of modified element> , <Action> , <Former name>)
<Name of the watched directory>: Character string
Full name of the watched directory.
<Name of modified element>: Character string
Name of the modified file or directory.
<Action>: Integer constant
Action performed:
fwCreateFileThe <Name of modified element> file or directory was created in <Directory>.
fwDeleteFileThe <Name of modified element> file or directory was deleted from <Directory>.
fwModifyFileThe <Name of modified element> file or directory was modified in <Directory>.
fwRenameThe <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.
Observaciones

Caution

This WLanguage procedure is run in a WLanguage thread.
Please note: the following processes cannot be run in threads:
  • opening windows with WLanguage functions such as Open, Use, Close, ... If windows are to be handled in threads (a rare case), a specific management system must be set up. For more details, see Opening a window in a secondary thread.
  • managing events.
  • managing timers.
For more details on threads, see Managing threads.
Clasificación Lógica de negocio / UI: Código neutro
Componente: wd300std.dll
Versión mínima requerida
  • Versión 18
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local