Compound assignment operators
- Last Updated: July 9, 2021
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
ABL has four compound assignment operators (+=,
-=, *=, and /=), which can be used to perform an operation and assign a
value, using a shorthand notation. These assignment operators make your code more
concise and easier to read and understand. Supported operations include addition
(numeric and date-based) and concatenation, subtraction (numeric and date-based),
multiplication, and division.
The following table compares the syntax for each assignment operator with the equivalent basic syntax, and notes which types of operations are supported.
| Operator | Assignment operator syntax | Equivalent basic syntax | Supported operations |
|---|---|---|---|
+= |
field
+= expression |
field
= field + (expression) |
Concatenation, numeric and date-based addition |
-= |
field
-= expression |
field
= field - (expression) |
Numeric and date-based subtraction |
*= |
field
*= expression |
field
= field * (expression) |
Numeric multiplication |
/= |
field
/= expression |
field
= field / (expression) |
Numeric division |
See the ABL Reference entries for more
information: