IndexHPLock Function | |
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.21
Syntax FUNCTION IndexHPLock(
lNewSetting AS USUAL
) AS LOGIC
public static bool IndexHPLock(
Usual lNewSetting
)
Request Example
View SourceParameters
- 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.
Note:
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:
1? IndexHPLock()
2? IndexHPLock(TRUE)
3? IndexHPLock()
See Also