Click or drag to resize

DbServer.BLOBDirectPut Method

X#
Put data in a BLOB file without referencing a specific field.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD BLOBDirectPut(
	nPointer,
	uBlob
) AS USUAL CLIPPER
Request Example View Source

Parameters

nPointer (Optional)
Type: Usual
A reference to previously stored BLOB data. This reference can be obtained using DBServer:BLOBDirectPut(), DBServer:BLOBDirectImport(), or DBServer:FieldInfo(DBS_BLOB_POINTER, nFieldPos). If other than 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, DBServer:BLOBDirectPut() releases the space associated with nOldPointer for reuse by other data. Therefore, it is illegal to use nOldPointer with any of the BLOB methods after passing it as an argument to this method. Use the method's return value to refer to the newly stored data.
uBlob (Optional)
Type: Usual
The data you want to put into the BLOB file. uBLOB can be any X# usual data type, except code block and object.

Return Value

Type: Usual
A numeric pointer to the uBLOB data.
Remarks
DBServer:BLOBDirectPut() stores variable length BLOB data without creating a link with a particular memo field in a data server. After adding data to a BLOB file using DBServer:BLOBDirectPut(), you should store the method'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 DBServer:BLOBRootPut()).
Examples
This example illustrates storing setup information in a BLOB file, then selectively retrieving the stored information:
X#
 1FUNCTION PutSettings(aColors AS ARRAY,;
 2aPaths AS ARRAY, aPW AS ARRAY) AS VOID
 3LOCAL aSettings AS ARRAY
 4LOCAL oDBSetup AS DBServer
 5oDBSetup := Setup{}
 6aSettings := {}
 7AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aColors))
 8AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aPaths))
 9AAdd(aSettings, oDBSetup:BLOBDirectPut(0, aPW))
10oDBSetup:BLOBRootPut(aSettings)
11oDBSetup:Close()
12FUNCTION GetColors() AS ARRAY
13LOCAL aSettings AS ARRAY
14LOCAL aColors  AS ARRAY
15LOCAL oDBSetup AS DBServer
16oDBSetup := Setup{}
17aSettings := oDBSetup:BLOBRootGet()
18aColors := oDBSetup:BLOBDirectGet(aSettings[1])
19oDBSetup:Close()
20RETURN aColors
See Also