BLOBDirectGet Function | |
Retrieve data stored in a BLOB file without referencing a specific field.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION BLOBDirectGet(
nPointer,
nStart,
nCount
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual BLOBDirectGet(
Usual nPointer = default,
Usual nStart = default,
Usual nCount = default
)
Request Example
View SourceParameters
- nPointer (Optional)
- Type: Usual
A pointer to the BLOB data.
This pointer can be obtained using BLOBDirectPut(), BLOBDirectImport(), or DBFieldInfo(DBS_BLOB_POINTER, nFieldPos).
- nStart (Optional)
- Type: Usual
The starting position in nPointer.
If nStart is positive, the starting position is relative to the leftmost character in nPointer.
If nStart is negative, it is relative to the rightmost character in nPointer.
If nStart is omitted, it is assumed to be 1.
- nCount (Optional)
- Type: Usual
The number of bytes of data to retrieve, beginning at nStart.
If nCount is larger than the amount of data stored, excess data is ignored.
If omitted, BLOBDirectGet() retrieves to the end of the data.
Return Value
Type:
Usual
The data retrieved from the BLOB file.
The data type of the return value depends on the actual data stored.
Use ValType() or UsualType() to determine the data type.
Remarks
BLOBDirectGet() retrieves data stored in a BLOB file without the need to reference a particular field in the database file.
It is particularly useful when accessing data that is larger than 64 KB, (such as memo fields created with the BLOBImport() function).
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:
1FUNCTION PutSettings(aColors AS ARRAY,;
2 aPaths AS ARRAY, aPassWords AS ARRAY) AS VOID
3 LOCAL aSettings AS ARRAY
4 USE setup NEW VIA DBFBLOB
5 aSettings := {}
6 AADD(aSettings, BLOBDirectPut(0, aColors))
7 AADD(aSettings, BLOBDirectPut(0, aPaths))
8 AADD(aSettings, BLOBDirectPut(0, aPassWords))
9 BLOBRootPut(aSettings)
10 CLOSE
11FUNCTION GetColors() AS ARRAY
12 LOCAL aSettings AS ARRAY
13 LOCAL aColors AS ARRAY
14 USE setup NEW VIA DBFBLOB
15 aSettings := BLOBRootGet()
16 aColors := BLOBDirectGet(aSettings[1])
17 CLOSE
18 RETURN aColors
See Also