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 / Administrar bases de datos / HFSQL / Funciones HFSQL Client/Server / Procedimiento WLanguage
  • WLanguage procedure executed in the main thread
  • Lenguaje Procedure ejecutado en un Thread secundario
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
WLanguage procedure called by HWatch
WLanguage procedure ("callback") called by HWatch when a change is made on the specified data file.
Ejemplo
// Lance la surveillance du fichier de données Commande
// La procédure TraiteCommande est appelée pour tout ajout d'enregistrement dans le fichier de données
HWatch(Commande, TraiteCommande, hRecNumAll, hsAdd)

PROCEDURE TraiteCommande(NomFic, NumEnreg, Action)
IF BitwiseAND(nAction, hsAdd) = hsAdd THEN
	Trace("Un ajout a été effectué dans le fichier de données: " + NomFic)
END
Sintaxis
HWatch_Callback(<Modified data file> , <Record number> , <Action>)
<Modified data file>: Character string
Name of the modified HFSQL data file.
<Record number>: Integer
Number of the modified record (equivalent to the number returned by HRecNum).
<Action>: Integer constant
Action that triggered the procedure. The possible values are:
hsAddProcedure started once a record is added into the data file.
hsCrossProcedure started once a record is crossed in the data file.
hsDeletionProcedure started once a record is deleted from the data file.
hsModificationProcedure started once a record is modified in the data file.

Caution: If a process adds a record modifies this record immediately after, HWatch is called once with a combination of the constants hsAdd and hsModification.
To identify these actions in Procedure WLanguage, you need to use the BitwiseAND function. . For example:
IF BitwiseAND(nAction, hsAdd) = hsAdd THEN ...
Observaciones

WLanguage procedure executed in the main thread

By default, this WLanguage procedure is called in the main thread of the application, with the HFSQL context that corresponds to the procedure:
  • If the procedure is a local procedure of a window that uses an independent context, the context of the window will be used.
  • If the procedure belongs to a component that uses an independent context, the context of the component will be used.
Caution:
The procedure associated with HWatch can be called at any time in the application.
If the procedure reads records or moves between records in the data files, this will have an impact on the application (like the timers).
Therefore, you may have to call HSavePosition and HRestorePosition to save the contexts of files used.
Multitask must not be used in the procedure code.

Lenguaje Procedure ejecutado en un Thread secundario

Si se llama al lenguaje WL Procedure en un Thread secundario :
  • el contexto HFSQL se copia la primera vez que se llama a WLanguage procedure called by HWatch. Solo se almacenan los directorios que contienen los archivos de datos en modo HFSQL Classic y/o las conexiones en modo HFSQL Client/Server.
  • Los elementos de la interfaz de usuario (ventanas, controles, etc.) no pueden ser manipulados en la Thread secundaria . Cuando un thread secundario debe interactuar con el usuario o actualizar la interfaz de usuario, debe utilizar un Process iniciado desde el thread principal. . Este proceso puede corresponder a:
    • un procedimiento global del proyecto o un procedimiento local (de una ventana, etc.) llamado con la función ExecuteMainThread,
    • el evento "Solicitud para actualizar la visualización" de una ventana, ejecutado con la función RequestRefreshUI.
Para obtener más información sobre este procedimiento, consulte Parámetros del procedimiento utilizado por la función WLanguage procedure called by HWatch.
Clasificación Lógica de negocio / UI: Código neutro
Componente: wd290hf.dll
Ver también
Versión mínima requerida
  • Versión 22
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2024

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