if thing && %0010 = 0 then print "thingo"
In the expression you're masking (ANDING) the constants of THING with 2 (%0010), then comparing the result with 0
So the expression will only be TRUE (1) when bit 2 isn't set in the THING variable. Your code sets this bit, so it doesn't print anything.
So we can detect on/off state with something like the following.
if thing && %0010 = 0 then print "Bit 2 OFF"
if thing && %0010 <> 0 then print "Bit 2 ON"
Now that's assuming Dbpro treats bit operators at higher precedence than compares. You may well have bracket the mask to ensure this is done first.
ie,
if (thing && %0010) = 0 then print "Bit 2 OFF"
if (thing && %0010) <> 0 then print "Bit 2 ON"