Click or drag to resize

BLOBRootLock Function

Obtain a lock on the root area of a BLOB file.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION BLOBRootLock() AS USUAL
View Source

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
Use BLOBRootLock() when accessing the database file in shared mode to obtain a lock on the root area of a BLOB file for reading from or writing to the root area. By default, this function operates on the currently selected work area.  It can be made to operate on an unselected work area by specifying it within an aliased expression
Examples
This example illustrates how to properly lock and unlock the root area of a BLOB file for a database file opened in shared mode.
X#
FUNCTION GetSettings()
        LOCAL aCustSettings AS ARRAY
        // Open a customer file in shared mode
        USE customer NEW SHARED INHERIT FROM {"DBFBLOB"}
        IF BLOBRootLock()
                aCustSettings := BLOBRootGet()
                BLOBRootUnlock()
        ELSE
                Alert("Could not obtain root lock of Customer;
                        file")
        ENDIF
        CLOSE
        RETURN aCustSettings
See Also