sx_GetBlobLength

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_GetBlobLength

VB Declaration

Declare Function sx_GetBlobLength Lib "Apollo9.dll"

(ByVal cpFieldName As String)

As Long

C Declaration

LONG FAR PASCAL sx_GetBlobLength

(BYTEP cpFieldName);

Description

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.

Parameters

cpFieldName: The name of the memo field that holds the BLOB.

Return Value

The size of the BLOB as a long integer.

VB Example

' 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

C Example

VOIDP vpVar;

 

vpVar = (VOIDP) sx_MemAlloc(sx_GetBlobLength("blobfield"));

if ((sx_GetBlob("blobfield", vpVar) != sx_GetBlobLength("blobfield"))

{

sx_MemDealloc(vpVar);

return(FAILURE);

}

See Also

sx_GetBlob, sx_PutBlob, sx_Replace