I've learned how to assign a new value to a variable, like: "From now on variable X is 5."
But how do you add/subtract from "current value"?
Back in the 80ies when I learned BASIC it was straightforward: If "X" was an integer and I wanted to add 4, then the command was "X=X+4", meaning "(new value of) X is (old value of) X, plus 4".
Do I really need to create a temporary variable, like
(Want to add 1 to X.)
~ y = X+1
~ X = y
But how do you add/subtract from "current value"?
Back in the 80ies when I learned BASIC it was straightforward: If "X" was an integer and I wanted to add 4, then the command was "X=X+4", meaning "(new value of) X is (old value of) X, plus 4".
Do I really need to create a temporary variable, like
(Want to add 1 to X.)
~ y = X+1
~ X = y