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
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
<Fuente>.Track (Función)
HFSQL Client/ServerDisponible solo con este tipo de conexión
Starts watching write actions (add, modify or delete) performed on a file in an HFSQL server. In case of modification, a specific procedure can be triggered.
This watch mechanism can be stopped with <Fuente>.TrackStop.
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
Commande.Surveille(TraiteCommande, hRecNumAll, hsAdd)
Sintaxis
<Result> = <Source>.Watch(<WLanguage procedure> [, <Record number> [, <Action to watch> [, <Runtime mode>]]])
<Result>: Booleano
  • True if the data file watch mechanism is enabled,
  • False otherwise. To get more details on the error, use ErrorInfo.
<Source>: Tipo de fuente especificada
Name of HFSQL data file to use. The data file is associated with a connection and with a server.
<WLanguage procedure>: Nombre del procedimiento
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 <Fuente>.Track.
<Record number>: Entero opcional
  • Number of the record to watch.
  • hRecNumAll constant to watch all the records in the data file.
<Action to watch>: Constante o combinación de constantes opcional
Actions to watch for which the procedure will be started:
hsAddMonitors the operations for adding records.
hsCrossMonitors the operations for crossing records.
hsDeletionMonitors the operations for deleting records.
hsModificationMonitors the operations for modifying records.
<Runtime mode>: Constante opcional
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 <Fuente>.Track 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 <Fuente>.Track.

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 <Fuente>.Track is called. Only the directories containing the data files in HFSQL Classic mode and/or the connections in HFSQL Client/Server mode are stored.
    Remark: If <Fuente>.ChangeDir is called between two calls to the <Fuente>.Track function, <Fuente>.ChangeDir is ignored. Example:
    UnFichier.Surveille(hSecondaryThread)
    // La fonction HChangeRep n'est pas prise en compte
    UnAutreFichier.ChangeRep()
    UnAutreFichier.Surveille(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 <Fuente>.Track.

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 <Fuente>.Track.
  • 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 <Fuente>.TrackStop.
Windows service:
<Fuente>.Track and <Fuente>.TrackStop can be used in a Windows service.
When <Fuente>.Track 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: wd290hf.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: 26/03/2024

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