BLOBRootPut Function |
Namespace: XSharp.RT
FUNCTION BLOBRootPut( uBLOB ) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })] public static Usual BLOBRootPut( Usual uBLOB = default )
Tip |
---|
Because the root data does not reference a particular record in the database file, the DBRLock() will not protect this root storage reference. Therefore, if the database file is opened in shared mode, you should use BLOBRootLock() before calling BLOBRootPut(). |
1FUNCTION UpdateSettings() 2 LOCAL aSettings AS ARRAY 3 USE customer NEW SHARED VIA "DBFCDX" 4 IF BLOBRootLock() 5 // Get any existing settings 6 aSettings := BLOBRootGet() 7 IF EMPTY(aSettings) 8 // This function would populate aSettings 9 // with default data 10 aSettings := GetDefaultSettings() 11 ENDIF 12 // This function would allow the user to 13 // modify the settings. 14 IF ModifySettings(aSettings) 15 // Finally, store the settings 16 BLOBRootPut(aSettings) 17 ENDIF 18 BLOBRootUnLock() 19 ELSE 20 aSettings := {} 21 Alert("Could not obtain a lock on the root; 22 area") 23 ENDIF 24 CLOSE 25 RETURN aSettings