Click or drag to resize

IndexHPLock Function

X#
Return and optionally change the setting that determines whether to use the High Performance (HP) locking schema for newly created .NTX files.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION IndexHPLock(
	lNewSetting AS USUAL
) AS LOGIC
Request Example View Source

Parameters

lNewSetting
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.

Return Value

Type: Logic
If lNewSetting is not specified, IndexHPLock() returns the current setting.
If lNewSetting is specified, the previous setting is returned.
Remarks
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.
Tip Tip
This function applies only if you are using the DBFNTX RDD. Important!
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.
Examples
This example illustrates the status of IndexHPLock() after several calls to the function:
X#
1? IndexHPLock()        // FALSE (initial setting)
2? IndexHPLock(TRUE)    // FALSE (previous setting)
3? IndexHPLock()        // TRUE  (current setting)
See Also