# Testing vars in math

**URL:** <https://forum.kirupa.com/t/testing-vars-in-math/87501>\
**Category:** Uncategorized\
**Created:** [April 21, 2005, 3:18pm UTC](https://forum.kirupa.com/t/testing-vars-in-math/87501 "2005-04-21T15:18:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weazol](https://avatars.discourse-cdn.com/v4/letter/w/f17d59/32.png) [@Weazol](https://forum.kirupa.com/u/Weazol)\
**Post date:** [April 21, 2005, 3:18pm UTC](https://forum.kirupa.com/t/testing-vars-in-math/87501/1 "2005-04-21T15:18:08Z")

</div>

on (keyPress “1”) {  
if (num1 = num2 + 1) {  
num3 = “1”;  
}  
}

whats wrong with that?

when i do that there it changes the value of num2 and then on the second press it changes the value of num1 also

basically what i want is if 1 is pressed and  
num1 - num2 = 1  
then continue to next frame and change num3 to 1

edit: after watching closley i noticed when it changes the number it changes num 1 to num2 + 1 not doing the if statement… but it doesnt really add it either… if num2 is 7 then num1 becomes 71
