Count_Bits

Syntax: Count_Bits(inputString, inputStringDataType)

Arguments:

  • inputString is the original string to be counted.
  • inputStringDataType is the input string data representation. Valid values are:

    0 or HEXADECIMAL_DATA, if the inputString is a hexadecimal representation (length of inputString must be divisible by 2)

    1 or BINARY_DATA, if the inputString is binary (length of inputString must be divisible by 8)

    2 or STRING_DATA, if the inputString is a string representation

Return Type: Integer

N: The total number of bits that have value 1

-1: Invalid inputStringDataType

-2: Invalid inputString

Description: This function will count the number of bits in the inputString that have bits set to 1.

Examples:

totalBits is an integer;

totalBits = Count_Bits(CRTRAN25.terminalVerificationResults, HEXADECIMAL_DATA);
if(totalBits > 5) then
{
                TriggerCase(SERVICE);
}

In this example, the Count_Bits function counts the total number of bits that are set to 1 in terminalVerificationResults. A service case will be triggered if the total number of bits that are set to 1 is greater than 5.

  • www.fico.com