<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_GetBlobLength |
Declare Function sx_GetBlobLength Lib "Apollo9.dll"
(ByVal cpFieldName As String)
As Long
LONG FAR PASCAL sx_GetBlobLength
(BYTEP cpFieldName);
Retrieves the length of a BLOB that was stored in a memo field. A BLOB is a binary large object. The maximum size of a BLOB is 16 megabytes. Elements that contain fixed length strings may be stored and retrieved.
cpFieldName: The name of the memo field that holds the BLOB.
The size of the BLOB as a long integer.
' procedure to retrieve an array of integers
Sub GetBlob()
Dim DynamicArray() As Integer
Dim BlobSize As Long
Dim BlobRead As Long
BlobSize = sx_GetBlobLength("blobfield")
' integers are 2 bytes so array size will be
' blob size / 2
ReDim DynamicArray(BlobSize / 2)
BlobRead = sx_GetBlob("blobfield", DynamicArray)
If BlobRead <> BlobSize Then
MsgBox "Array read error"
End If
End Sub
VOIDP vpVar;
vpVar = (VOIDP) sx_MemAlloc(sx_GetBlobLength("blobfield"));
if ((sx_GetBlob("blobfield", vpVar) != sx_GetBlobLength("blobfield"))
{
sx_MemDealloc(vpVar);
return(FAILURE);
}