Return and optionally change the setting that determines whether to use the new locking offset of -1 (0xFFFFFFFF) for .NTX files.
XSharp.RT (in XSharp.RT.dll) Version: 2.2a
Syntax View Source
lNewSetting AS USUAL
) AS LOGIC
public static bool NewIndexLock(
- Type: Usual
TRUE uses the new locking offset. FALSE uses a locking offset of 1 billion bytes.
The initial default is FALSE.
If <lNewSetting> is not specified, NewIndexLock() returns the current setting. If <lNewSetting> is specified, the previous setting is returned.
By default, this function sets the index locking offset 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 offsets in the same work area.
This setting affects only newly created index files. It has no effect on existing files, in which locking offset is determined by information stored in the file's header record.
Note: This function may not be implemented for RDDs other than DBFNTX.
Index files created with NewIndexLock(FALSE) in effect have a built-in limitation which limits the size of the database files to 1 GB. If you do not require compatibility with Xbase applications, you can use NewIndexLock(TRUE) to implement a less restrictive locking offset that does not limit the file size in any way.
Important! If your application must share data with an Xbase product, either simultaneously or at different times, do not set NewIndexLock(TRUE) unless this can also be done in the other applications as well. Doing so will make your .NTX files incompatible with these products.
This example illustrates the status of NewIndexLock() after several calls to the function:
? NewIndexLock() // FALSE (initial setting)
? NewIndexLock(TRUE) // FALSE (previous setting)
? NewIndexLock() // TRUE (current setting)