Hi All,
I need to read the individual state of a bit , can sombody help me on this subject.
thanks,
dirk
Read individual bits from a byte in VO
Read individual bits from a byte in VO
Hello Dirk,
a sample
Stefan
a sample
Code: Select all
LOCAL n AS INT
n := 3
IF _AND(n,0x01) > 0 //true
?"Bit0"
ENDIF
IF _AND(n,0x02) > 0 //true
?"Bit1"
ENDIF
IF _AND(n,0x04) > 0 //false
?"Bit2"
ENDIF
Read individual bits from a byte in VO
Hi Dirk,
if you like shifting bits
Stefan
if you like shifting bits
Code: Select all
LOCAL n AS INT
n := 3
IF _AND(n,1) > 0 //true
?"Bit0"
ENDIF
IF _AND(n>>1,1) > 0 //true
?"Bit1"
ENDIF
IF _AND(n>>2,1) > 0 //false
?"Bit2"
ENDIF
Read individual bits from a byte in VO
Hi Stefan,
thanks for the reply i give it a try.
regards,
dirk
thanks for the reply i give it a try.
regards,
dirk