Board Thread:Questions and Answers/@comment-24720902-20130524153123/@comment-5334617-20140705001835

CTR=0 IF B AND 1 THEN CTR=1 IF B AND 2 THEN CTR=2 IF B AND 4 THEN CTR=CTR+4 IF B AND 8 THEN CTR=CTR+8

Where  comes from , a single line of code will accomplish what you're trying to do here...

CTR=B AND 15