How To Ask A Variable Its Previous Value When It Changes Of Value?

Hello Kirupians,

This is a little harder than you may think…

I have an input text which gives a variable a value depending on what the user type. At the beginning of the program, this variable is set to 5, so it will be reflected in the input text box, but then I have an interval asking for the value each half a second, so lets say that the user doesn’t change the value, the variable will be adding new values each half a second, for example:

previous value = 5, current value = 5 (after half a second) previous value = 5, current value = 5 (after half a second) previous value = 5, current value = 5, so it will be 5 al the time until the user changes it.

I just want to ask the variable its previous value, but just when the variable’s value changes, for exmple:

previous value = 5, current value = 5 (after half a second) previous value = 5, current value = 5 (User type “8”, after half a second) previous value = 5, current value = 8 U[/U] , (after half a second) previous value = 8, current value = 8, (after half a second) previous value = 8, current value = 8.

I want to ask the variable its previous value, but just when it changes of value…

Is there an instruction or something like that like “onValueChange” or something like that?

THANKS!!!