[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
BLOBDIRECTPUT()
Put data in a BLOB file without referencing a specific field
------------------------------------------------------------------------------
Syntax
BLOBDIRECTPUT(<nOldPointer>, <uBLOB>) --> nNewPointer
Arguments
<nOldPointer> is a reference to previously stored BLOB data. This
reference can be obtained using BLOBDIRECTPUT(), BLOBDIRECTIMPORT(), or
DBFIELDINFO(DBS_BLOB_POINTER, <nFieldPos>). If other than zero (0), the
data referenced by <nOldPointer> is replaced by <uBLOB>; otherwise,
<uBLOB> is added to the current contents of the BLOB file.
Important! If specified, BLOBDIRECTPUT() releases the space
associated with <nOldPointer> for reuse by other data. Therefore, it is
illegal to use <nOldPointer> with any of the BLOB functions after
passing it as an argument to this function. Use the function's return
value to refer to the newly stored data.
<uBLOB> is the data you want to put into the BLOB file. <uBLOB> can
be any CA-Clipper data type except code block or an object.
Returns
BLOBDIRECTPUT() returns a numeric pointer to the <uBLOB> data.
Description
BLOBDIRECTPUT() stores variable length BLOB data without creating a link
with a particular memo field in a database file. After adding data to a
BLOB file using BLOBDIRECTPUT(), you should store the function's return
value, as this is the only way to access the data from the BLOB file.
It is up to you, the developer, to provide permanent storage for this
reference (see BLOBROOTPUT()).
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 storing setup information in a BLOB
file, then selectively retrieving the stored information:
FUNCTION PutSettings(aColors,;
aPaths, aPassWords)
LOCAL aSettings
USE Setup NEW VIA "DBFMEMO"
aSettings := {}
AADD(aSettings, BLOBDIRECTPUT(0, aColors))
AADD(aSettings, BLOBDIRECTPUT(0, aPaths))
AADD(aSettings, BLOBDIRECTPUT(0, aPassWords))
BLOBROOTPUT(aSettings)
CLOSE
FUNCTION GETCOLORS()
LOCAL aSettings
LOCAL aColors
USE Setup NEW VIA "DBFMEMO"
aSettings := BLOBROOTGET()
aColors := BLOBDIRECTGET(aSettings[1])
CLOSE
RETURN aColors
Files Library is CLIPPER.LIB.
See Also:
BLOBDIRECTGET()
BLOBEXPORT()
BLOBGET()
BLOBIMPORT()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson