Skip to main content

Addition (+)

Produces the numeric sum of two operands, after interpreting them as numbers.


The Addition operator (+) produces the sum of two numerically interpreted operands.


The following example performs addition on two locally defined variables:

 SET x = 4
 SET y = 5
 WRITE "x + y = ",x + y // 9

The following example performs string arithmetic on two operands that have leading digits, adding the resulting numerics:

 WRITE "4 Motorcycles" + "5 bicycles" // 9

The following example illustrates that leading zeros on a numerically evaluated operand do not affect the results the operator produces:

 WRITE "007" + 10 // 17
FeedbackOpens in a new tab