PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • WLanguage procedure executed in the main thread
  • WLanguage procedure executed in a secondary thread
  • Special cases
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
<Source>.Track (Function)
In french: <Source>.Surveille
HFSQL Client/ServerAvailable only with this kind of connection
Starts tracking write actions (addition, modification or deletion) performed on a file found in an HFSQL server. In case of modification, a specific procedure can be triggered.
This track can be stopped by <Source>.TrackStop.
Example
// Starts tracking the Order data file
// The ProcessOrder procedure is called whenever a record is added to the data file
Order.Track(ProcessOrder, hRecNumAll, hsAdd)
Syntax
<Result> = <Source>.Track(<WLanguage procedure> [, <Record number> [, <Action to track> [, <Runtime mode>]]])
<Result>: Boolean
  • True if the tracking 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>.Track.
<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.
hsCrossMonitors the operations for crossing records.
hsDeletionMonitors the operations for deleting records.
hsModificationMonitors the operations for modifying records.
<Runtime mode>: Optional constant
New in version 28
WLanguage procedure execution mode:
hSecondaryThreadExecute the WLanguage procedure in a secondary thread.

By default, the WLanguage procedure is executed in the main thread.
Remarks

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>.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 <Source>.Track.
New in version 28

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>.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.
  • 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 event "Request for refreshing the display" of a window run by RequestRefreshUI.
For more details on this procedure, see Parameters of the procedure used by <Source>.Track.

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 <Source>.Track.
  • 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 <Source>.TrackStop. <Source>.Track and <Source>.TrackStop can be used in a Windows service.
Component: wd280hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment