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
  • WLanguage procedure executed in the main thread
  • WLanguage procedure executed in a secondary thread
  • Special cases
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
Advertencia
A partir de la versión 2024, Source.Track se conserva por motivos de compatibilidad. Esta función ha sido reemplazada por <Source>.Watch.
Trigger monitoring of write actions (add, modify or delete) performed on a data file present on an HFSQL server. In case of modification, a specific procedure can be triggered.
This watch mechanism can be stopped with <Source>.WatchStop.
Ejemplo
// Starts watching the Order data file
// The ProcessOrder procedure is called whenever a record is added to the data file
Order.Watch(ProcessOrder, hRecNumAll, hwAdd)
Sintaxis
<Result> = <Source>.Monitors(<WLanguage procedure> [, <Record number> [, <Action to watch> [, <Runtime mode>]]])
<Result>: Boolean
  • True if the data file watch mechanism is enabled,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Source>: Type corresponding to the specified source
Name of HFSQL data file to use. The data file is associated with a connection and with a server.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure ("callback") called when a change is made in the specified data file.
For more details on this procedure, see Parameters of the procedure used by <Source>.Watch.
<Record number>: Optional integer
  • Number of the record to watch.
  • hRecNumAll constant to watch all the records in the data file.
<Action to watch>: Optional constant (or combination of constants)
Actions to watch for which the procedure will be started:
hwAddMonitors the operations for adding records.
Novedad versión 2025
In previous versions, this constant corresponds to hsAdd.
hwCrossMonitors the operations for crossing records.
Novedad versión 2025
In previous versions, this constant corresponds to hsCross.
hwDeleteMonitors the operations for deleting records.
Novedad versión 2025
In previous versions, this constant corresponds to hsDeletion.
hwModifyMonitors the operations for modifying records.
Novedad versión 2025
In previous versions, this constant corresponds to hsModification.
<Runtime mode>: Optional constant
WLanguage procedure execution mode:
hSecondaryThreadExecute the WLanguage procedure in a secondary thread.

By default, the WLanguage procedure is executed in the main thread.
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 <Source>.Watch 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).
It may therefore be necessary to use: Multitask must not be used in the procedure code.

For more details on this procedure, see Parameters of the procedure used by <Source>.Watch.

WLanguage procedure executed in a secondary thread

If the WLanguage procedure is called in a secondary thread:
  • the HFSQL context is copied the first time <Source>.Watch is called. Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
    Note: If <Source>.ChangeDir is called between two calls to the <Source>.Watch function, <Source>.ChangeDir is ignored. Example:
    AFile.Watch(hSecondaryThread)
    // The HChangeDir function is ignored
    AnotherFile.ChangeDir()
    AnotherFile.Watch(hSecondaryThread)
  • UI elements (windows, controls, etc.) cannot be manipulated in the secondary thread. When a secondary thread must interact with the user or update the UI, it must use a process started from the main thread. This process can correspond to:
    • a global procedure of the project or a local procedure (of a window, etc.) called by ExecuteMainThread,
    • the "Request for refreshing the display" event of a window run by RequestRefreshUI.
For more details on this procedure, see Parameters of the procedure used by <Source>.Watch.

Special cases

Watching is defined for a data file and a connection:
  • If the physical name or the connection associated with the logical file name changes, the file watched by the server remains the one specified during the call to <Source>.Watch.
  • If the connection is closed, the watch mechanism is automatically stopped.
  • Watching continues if the connection is lost then restored by automatic reconnection.
To stop watching the data file, use <Source>.WatchStop.
Windows service:
<Source>.Watch and <Source>.WatchStop can be used in a Windows service.
When <Source>.Watch is used in a Windows service, it can only be tested on the deployed service, and not when testing the service via the "Go" option.
Componente: wd300hf.dll
Versión mínima requerida
  • Versión 25
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 12/06/2025

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