Clear_Bit
Syntax: Clear_Bit(inputString, inputStringDataType, position)
Arguments:
- inputString is the original string to be cleared.
-
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
- position is the position of the inputString to be cleared from left. It is 1-based index. The value of this field is in binary representation position.
Return Type: Integer
1: Success
-1: Invalid position value or inputStringDataType
-2: Invalid inputString
Description: This function will set the value of a bit at a specified position to 0. The inputString will be replaced with a new string that has the bit cleared in the position parameter.
Examples:
returnCode is an integer;
returnCode = Clear_Bit(CRTRAN25.userData08, STRING_DATA, 8);
In this example, the Clear_Bit function clears the bit in position 8 of userData08.