blobDescriptor object
When an object (structure) needs to be sent to a process other than the ScriptEase 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 to be sent. This description tells how the properties of the object are stored in memory and used with functions such as 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. 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 defined above:
var bd = new blobDescriptor()blobDescriptor() ;
bd.width = UWORD32;
bd.height = UWORD32;
You can now pass bd as a blobDescriptor parameter to functions, (such as SElib.dynamicLink(), Clib.fread(), and Clib.fwrite(), which might require one. The values assigned to the properties depend on what the receiving function expects. In the example above, 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.
The following values may be used for blobDescriptors.
UWORD8 |
Stored as a byte |
SWORD8 |
Stored as an integer |
UWORD16 |
Stored as an integer |
SWORD16 |
Stored as an integer |
UWORD24 |
Stored as an integer |
SWORD24 |
Stored as an integer |
UWORD32 |
Stored as an integer |
SWORD32 |
Stored as an integer |
FLOAT32 |
Stored as a float |
FLOAT64 |
Stored as a float |
FLOAT80 |
Stored as a float (not available in Win32) |
If a 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.
See Win32 structure definitions.