blobSetValue()
Writes "value" from byte position "offset" with "len" bytes to the blob.
Synopsis
int blobSetValue(blob &target, int offset,
type value, int len[, bool bigEndian])
Parameters
Parameter | Description |
---|---|
target | The blob |
offset | From this position a value is that to a blob |
value | Value of any type, which has to be inserted |
len | Length of the value |
bigEndian | Defines whether a value is a Big Endian or Little Endian, TRUE uses bigEndian |
Return Value
With an error -1, otherwise offset + length of the value as an integer
Errors
Missing or wrong arguments
Note that the null byte is not written in case of string variables.
Description
If data are sent in a blob, then the data have to be treated with CTRL functions for using the data in CTRL. Writes "value" from byte position "offset" with "len" bytes to the blob.
Example
main()
{
blob target;
int len, pos;
string s;
int value;
bool bigendian;
s = "FFAB003AFFAB";
target = s;
DebugN(target);
len = 1;
pos = 3;
value = 5;
bigendian = TRUE;
DebugN("Blob SetValue : " + blobSetValue( target, pos,
value, len, bigendian ));
// debugs the pos+len= 4, where the value has been set
DebugN(target);
//ff ab 0 5 ff ab
}
Assignment
Blob functions
Availability
CTRL