Click or drag to resize

Functions.NewIndexLock Method

Return and optionally change the setting that determines whether to use the new locking offset of -1 (0xFFFFFFFF) for .NTX files.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.17
 FUNCTION NewIndexLock(
	lNewSetting AS USUAL
Request Example View Source


Type: Usual
TRUE uses the new locking offset. FALSE uses a locking offset of 1 billion bytes.
The initial default is FALSE.

Return Value

Type: Logic
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:
1? NewIndexLock()        // FALSE (initial setting)
2? NewIndexLock(TRUE)    // FALSE (previous setting)
3? NewIndexLock()        // TRUE  (current setting)
See Also