; And Example ; ----------- ; And is true only when BOTH sides are true - the everyday way to ; combine conditions in an If. On plain integers it also works ; bitwise, keeping only the bits set in both values. keys=3 health=75 ; Logical use: both conditions must hold If keys>0 And health>50 Then Print "You have "+keys+" keys and "+health+" health - enter the dungeon!" Else Print "You are not ready for the dungeon." EndIf Print "" ; Bitwise use: only bits set in BOTH values survive a=%1100 b=%1010 Print "a = "+Bin$(a)+" ("+a+")" Print "b = "+Bin$(b)+" ("+b+")" Print "a And b = "+Bin$(a And b)+" ("+(a And b)+")" Print "" ; Bitwise And tests flags: is bit 4 set in the combined value? flags=1 Or 4 If flags And 4 Then Print "Flag 4 is set in flags." Print "" Print "Press any key to close the example" WaitKey End