Core.Terms.DecodeInteger

From emotive
Jump to navigation Jump to search

Classification

Name DecodeInteger
Short Description Returns the decoded Integer value of the ByteField argument.
Class Term
Extension OTX Core library
Group Integer conversion terms
Exceptions OutOfBoundsException
Checker Rules -
Standard Compliant Yes

OTL Syntax

IntegerTerm = Conversion.DecodeInteger(EncodingType, Endianness, ByteFieldTerm);

Description

DecodeInteger term returns the decoded Integer value of the ByteField argument. The term provides control over the byte order which be used for decoding as well as the way how the ByteField be decoded regarding n-bit unsigned, n-bit signed binary or n-bit two's complement interpretation, where nis the ByteField's size multiplied by 8 (in other words: the total number of bits in the original ByteField).

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
Integer The decoded Integer value of the ByteField argument

Properties

Name Data Type Class Default Cardinality Description
EncodingType EncodingType Value @EncodingType:TWOS-COMPLEMENT [1] Specifies how the bytes of the ByteField be interpreted. EncodingType = {UNSIGNED|SIGNED-BINARY|TWOS-COMPLEMENT}
ByteOrder Endianness Value @Endianness:LITTLE-ENDIAN [1] Specifies the byte order which be respected prior to decoding the ByteField value. Endianness = {LITTE-ENDIAN|MIXED-ENDIAN|BIG-ENDIAN}. LITTLE-ENDIAN is the default value.
Bytes ByteField Term - [1] Represents the ByteField value which be converted to Integer.

OTL Examples

Integer result;
result = Conversion.DecodeInteger(@EncodingType:TWOSCOMPLEMENT, @Endianness:LITTLEENDIAN, &00 FF);
//Returns the result = -256

See also

EncodeInteger