You should apply comparison operators instead of assignment operators in line 25 and 26 as follows. IF ANIM==10 THEN ... IF ANIM==20 THEN ...