Getbit
getbit
returns the bit value of a bit from an integer. The result is an integer that can have a value of 0 or 1.
getBit( INT_VALUE, BIT_TO_GET)
INT_VALUE
Integer to get the bit from. (TinyInt, ShortInt, Integer)BIT_TO_GET
Number of the bit to return. Bit numbers start at 1. getbit(E,N)
Local Integer INT_VALUE,RESULTINT_VALUE=8RESULT = getBit(INT_VALUE,4) # RESULT = 1. Note Bit numbers start at 1, not 0. That is 2^(4-1)=8