In osl you can use an assignment operator to set a variable to itself but modified by an operator. This allows you to compact code into a simpler format.
An example of an assignment operator is += where it adds/joins a value to the variable
variable =10// the variable is 10variable +=10// the variable is now 20
All Assignment operators
variable += number// adds a number to the variable valuevariable += string// joins a string to the variable valuevariable -= number// subtracts a number from the variable valuevariable /= number// divides the variable value by a numbervariable *= number// multiplies the variable value by a numbervariable %= number// sets the varable value to "variable % number"variable ^= number// sets the varable value to "variable ^ number"
Increment/Decrement
variable ++// increase a variable by exactly 1variable --// decrease a variable by exactly 1