Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Guide To CA-Clipper - <b>blobrootput()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 BLOBROOTPUT()
 Store data in the root area of a BLOB file
------------------------------------------------------------------------------
 Syntax

     BLOBRootPut(<uBLOB>) --> lSuccess

 Arguments

     <uBLOB> is the data you want to put into the BLOB file's root area.
     <uBLOB> can be any CA-Clipper usual data type except code block and
     object.

 Returns

     BLOBROOTPUT() returns true (.T.) if successful; otherwise, it returns
     false (.F.).

 Description

     BLOBROOTPUT() allows the storage of one--and only one--piece of data to
     a BLOB file's root area (there is no size limitation on this one piece
     of data).  After storing the new data, BLOBROOTPUT() releases the space
     associated with any data previously stored in the BLOB file's 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.

     Note:  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().

 Examples

     .  This example uses BLOBROOTPUT() to store system settings to a
        BLOB file after modification:

        FUNCTION UPDATESETTINGS()
           LOCAL aSettings

           USE customer NEW SHARED VIA "DBFCDX"

           IF BLOBROOTLOCK()
              // Get any existing settings
              aSettings := BLOBROOTGET()

              IF Empty(aSettings)
                 // This function would populate aSettings
                 // with default data
                 aSettings := GETDEFAULTSETTINGS()
              ENDIF

              // This function would allow the user to
              // modify the settings.
              IF ModifySettings(aSettings)
                 // Finally, store the settings
                 BLOBRootPut(aSettings)
              ENDIF
              BLOBROOTUNLOCK()
           ELSE
              aSettings := {}

              Alert("Could not obtain a lock on the root;
                 area")
           ENDIF

           CLOSE

           RETURN aSettings


See Also: BLOBROOTGET() BLOBROOTLOCK()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson