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 fWatchFile
WLanguage procedure ("callback") called by fWatchFile when a change is made to the watched file.
This can be a local, global, or internal.
Ejemplo
// Nom du fichier à surveiller
sNomFichier is string = "C:\Temp\MonRep\MonFichier.extension"
// La procédure TraiteModification sera appelée lorsque le fichier 
// "C:\Temp\MonRep\MonFichier.extension" sera modifié.
IF fWatchFile(sNomFichier, fSurveilleFichier_Callback, ...
		fwCreateFile + fwModifyFile + fwDeleteFile + ...
		fwRename) THEN
	// On informe l'utilisateur de la mise sous surveillance du fichier
	Info("La mise sous surveillance du fichier " + sNomFichier + " a réussi.")
ELSE
	// On informe l'utilisateur de l'échec de la mise sous surveillance du fichier
	Info("La mise sous surveillance du fichier " + sNomFichier + " a échoué.")
END

// Code de la procédure interne
INTERNAL PROCEDURE fSurveilleFichier_Callback(sNomComplet, sNomFichierSurveille, nAction, sAncienNomFichier)
	sDesignationAction is string
	// La désignation de l'action subie dépend de nAction
	SWITCH nAction
		CASE fwCreateFile: sDesignationAction = "Création de fichier"
		CASE fwDeleteFile: sDesignationAction = "Suppression de fichier"
		CASE fwModifyFile: sDesignationAction = "Modification de fichier"
		CASE fwRename: sDesignationAction = "Renommage de fichier"
	END
	// Ajout d'une ligne contenant les informations de la modification 
	// dans le champ Table TABLE_MODIFICATIONS
	TableAddLine(TABLE_MODIFICATIONS, sNomComplet, sNomFichierSurveille, ...
		sDesignationAction, sAncienNomFichier)
END
Sintaxis
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.
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
Ver también
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