Quote Originally Posted by longpole001 View Post
would it be
if value > 2 then VAR.0[VALUE - 1]
cos if value below 2 would be incorrect bit ??
I'm a noob myself, but no... The VAR.0[] syntax is a way of addressing each bit and, while it affects the value of the byte, the bits do not interact.
Some examples:

VAR= %00000000 : VAR.0[0] = 1 : 'VAR NOW EQUALS %00000001
VAR= %00000100 : VAR.0[0] = 1 : 'VAR NOW EQUALS %00000101
VAR= %10100001 : VAR.0[1] = 1 : 'VAR NOW EQUALS %10100011
VAR= %11111100 : VAR.0[7] = 0 : 'VAR NOW EQUALS %01111101

As you can see by the last example, turning "off" bits is the same, only assign a 0. Reassigning a bit, already set (or cleared) has no effect.