Addition
Previous  Next

To perform addition with variables, you use the addition sign (+), for example: a = b + 1

There are a few shortcuts you can use as well in certain circumstances. If you're going to increment a variable by 1, you can use the increment operator instead (++): a++, instead of using a standard assignment operation (a = a + 1).

Another instance is when you're adding to the variable in a manner like this: a = a + 4, you can shorten that up by using the += operator: a+=4

For more information on the increment and self assigning operator, please view the Special Operators section of the help document.