PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
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
WLanguage procedure called by HTrack
WLanguage procedure ("callback") called by HTrack when a change is made on the specified data file.
Example
// Starts tracking the Order data file
// The ProcessOrder procedure is called whenever a record is added to the data file
HTrack(Order, ProcessOrder, hRecNumAll, hsAdd)
 
PROCEDURE ProcessOrder(FileName, RecNum, Action)
IF BinaryAND(nAction, hsAdd) = hsAdd THEN
Trace("An addition was made in the data file: " + FileName)
END
Syntax
HTrack_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.
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.

Caution: If a process adds a record modifies this record immediately after, HTrack is called once with a combination of the constants hsAdd and hsModification.
BinaryAND must be used to identify these actions in the WLanguage procedure. For example:
IF BinaryAND(nAction, hsAdd) = hsAdd THEN ...
Remarks
This 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.
Business / UI classification : Neutral code
Component : wd250hf.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment