PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • WLanguage procedure
  • Special cases
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
HTrack (Function)
In french: HSurveille
HFSQL Client/ServerAvailable only with this kind of connection
Starts tracking the write actions (addition, modification or deletion) performed on a file found on a HFSQL server. In case of modification, a specific procedure can be triggered.
This track can be stopped by HTrackStop.
Example
// Starts tracking the Order file
// The ProcessOrder procedure is called whenever a record is added into the file
HTrack(Order, ProcessOrder, hRecNumAll, hsAdd)
Syntax
<Result> = HTrack(<File name> , <WLanguage procedure> [, <Record number> [, <Action to Track>]])
<Result>: Boolean
  • True if the tracking is enabled,
  • False otherwise. To find out the error details, use ErrorInfo.
<File name>: Optional character string (with or without quotes)
Name of HFSQL data file to use. The data file is associated with a connection and with a server.
If this parameter corresponds to an empty string (""), HTrack handles the last data file used by the last function for HFSQL management (starting with the letter H).
<WLanguage procedure>: Procedure name
Name of WLanguage procedure ("callback" procedure) that will be called when a change is detected in the specified data file. This procedure has the following format:
PROCEDURE <Procedure name>(<Name of modified file>,
<Modified record number>, <Action>)

where:
  • <Name of modified file> is a data source corresponding to the modified HFSQL data file,
  • <Modified record number> corresponds to the number of the modified record (equivalent to the number returned by HRecNum),
  • <Action> corresponds to the action that triggered the procedure. The possible values are:
    hsAddProcedure started once a record is added into the data file.
    hsModificationProcedure started once a record is modified in 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.
<Record number>: Optional integer
  • Number of the record to track.
  • hRecNumAll constant to track all the records found in the data file (which means the entire data file).
<Action to Track>: Optional constant (or combination of constants)
Actions to track for which the procedure will be started:
hsAddMonitors the operations for adding records.
hsModificationMonitors the operations for modifying records.
hsCrossMonitors the operations for crossing records.
hsDeletionMonitors the operations for deleting records.
Remarks

WLanguage procedure

The WLanguage procedure is called in the main thread of the application, with the HFSQL context corresponding to the procedure:
  • If the procedure is a local procedure of a window that is using an independent context, the context used will be the one of the window.
  • If the procedure belongs to a component that is using an independent context, the context used will be the one of the component.
Caution:
The procedure associated with HTrack can be called at any time in the application.
If the procedure performs HFSQL browses or moves in the data files, this will impact 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.

Special cases

The track 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 tracked by the server remains the one specified during the call to HTrack.
  • If the connection is closed, the track is automatically stopped.
  • The tracking continues if the connection is lost then restored by automatic reconnection.
To stop tracking the data file, use HTrackStop.
Versions 24 and later
HTrack and HTrackStop can be used in a Windows service.
New in version 24
HTrack and HTrackStop can be used in a Windows service.
HTrack and HTrackStop can be used in a Windows service.
Component : wd250hf.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment