blobGetValue()

Reads "value" from byte offset "offset" with "len" bytes from blob.

Synopsis

int blobGetValue(blob source, int offset, type &value, int len[, bool bigEndian])

Parameters

Parameter Description
source The blob
offset From this position, a value of length len is read from blob.
value Value of any type that has to be appended
len Length of value
bigEndian Defines whether a value is a Big Endian or Little Endian, TRUE uses bigEndian

Return Value

Witrh an error -1, otherwise 0

Errors

Missing or wrong arguments

Description

When data is sent in a blob, then the data has to be treated with CTRL functions to use the data in CTRL. Reads

"value" from byte offset "offset" with "len" bytes from blob.

Example

main()
{
  blob source;
  int len, pos;
  string s;
  int value;
  bool bigendian;
  s = "DDAB003AFFABFFAB003AFFAFFAB003AFFABFFAB003AFFABB";
  source = s;
  DebugN(source, bloblen(source));
  len = 2;
  pos = 1;
  bigendian = TRUE;
  blobGetValue( source, pos, value, len, bigendian );
  DebugN("Blob GetValue : " , value );
// Debugging -21760, integer value of the decimal system
}

Assignment

Blob functions

Availability

CTRL