Not "0 or 1" but "0 or NOT 0". You should write IF(BT AND 16)!=0 THEN in case of @BUTTONTRUE. 16 stands for A button btw. (You can replace this 16 with #A.)