Siebel eScript Language Reference > Siebel eScript Commands > BLOB Objects >

The blobDescriptor Object


The blobDescriptor Object describes the structure of the BLOB. When an object needs to be sent to a process other than the Siebel eScript interpreter, such as to a Windows API function, a blobDescriptor object must be created that describes the order and type of data in the object. This description tells how the properties of the object are stored in memory and is used with functions like Clib.fread() and SElib.dynamicLink().

A blobDescriptor has the same data properties as the object it describes. Each property must be assigned a value that specifies how much memory is required for the data held by that property. The keyword "this" is used to refer to the parameters passed to the constructor function and can be conceptually thought of as "this object." Consider the following object:

Rectangle(width, height)
{
   this.width = width;
   this.height = height;
}

The following code creates a blobDescriptor object that describes the Rectangle object:

var bd = new blobDescriptor();

bd.width = UWORD32;
bd.height = UWORD32;

You can now pass bd as a blobDescriptor parameter to functions that require one. The values assigned to the properties depend on what the receiving function expects. In the preceding example, the function that is called expects to receive an object that contains two 32-bit words or data values. If you write a blobDescriptor for a function that expects to receive an object containing two 16-bit words, assign the two properties a value of UWORD16.

One of the following values must be used with blobDescriptor object properties to indicate the number of bytes needed to store the property:

Value
Description

WCHAR

Handled as a native Unicode string

UWORD8

Stored as an unsigned byte

SWORD8

Stored as an integer

UWORD16

Stored as an unsigned, 16-bit integer

SWORD16

Stored as a signed 16-bit integer

UWORD24

Stored as an unsigned 24-bit integer

SWORD24

Stored as a signed 24-bit integer

UWORD32

Stored as an unsigned 32-bit integer

SWORD32

Stored as a signed 32-bit integer

FLOAT32

Stored as a floating-point number

FLOAT64

Stored as a double-precision floating-point number

STRINGHOLDER

Used to indicate a value that is assigned a string by the function to which it is passed. (It allocates 10,000 bytes to contain the string, then truncates this length to the appropriate size, removes any terminating null characters, and initializes the properties of the string.)

If the blobDescriptor describes an object property that is a string, the corresponding property should be assigned a numeric value that is larger than the length of the longest string the property may hold. Object methods usually may be omitted from a blobDescriptor.

BlobDescriptors are used primarily for passing eScript's JavaScript-like data structures to C or C++ programs and to the Clib methods, which expect a very rigid and precise description of the values being passed.

Siebel eScript Language Reference