Set_Bit
Syntax: Set_Bit(inputString, inputStringDataType, position)
Arguments:
- inputString is the original string to be set.
-
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 set 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 1. The inputString will be replaced with a new string that has the bit set in the position parameter.
Examples:
returnCode is an integer;
returnCode = Set_Bit(CRTRAN25.userData08, STRING_DATA, 8);
In this example, the Set_Bit function sets the bit in position 8 of userData08.