Return and optionally change the setting that determines whether to use the High Performance (HP) locking schema for newly created .NTX files.
XSharp.RT (in XSharp.RT.dll) Version: 2.5
lNewSetting AS USUAL
) AS LOGIC
public static bool IndexHPLock(
- Type: Usual
TRUE uses the HP locking schema. FALSE uses the standard locking schema as defined by NewIndexLock().
The initial default is FALSE, which can be changed using the HPLock entry (1 means TRUE and 0 means FALSE) in the X# section of WIN.INI.
If <lNewSetting> is not specified, IndexHPLock() returns the current setting.
If <lNewSetting> is specified, the previous setting is returned.
By default, this function sets the index locking schema for the current work area.
It can be made to operate on an unselected work area by specifying it within an aliased expression. Thus, you can set a separate flag for each work area. You cannot, however, use index files with different locking schema in the same work area.
This setting affects only newly created index files.
It has no effect on existing files, in which locking schema is determined by information stored in the file's header record.
This function applies only if you are using the DBFNTX RDD.
If your application must share data with an Xbase product, either simultaneously or at different times, do not set IndexHPLock(TRUE) or include HPLock=1 in the X# settings in WIN.INI. Doing so will make your .NTX files incompatible with these products.
This example illustrates the status of IndexHPLock() after several calls to the function: