Skip to content
AlertaChartAlertaScript / docs
AlertaScript / compound-assignment
On this pageSignatureParametersReturnsExample

Utilities / Reference

compound-assignment

Pine v5/v6 parity: `x += y`, `x -= y`, `x *= y`, `x /= y`, `x %= y` are supported and desugar to `x := x + y` (etc.). Works on any reassignable variable (let/var/varip) and inside function bodies, if branches, for/while loops.

compound-assignment += <expr> // also -=, *=, /=, %= → void

Parameters

NameTypeRequiredDefaultDescription
nameidentifierYes—Target variable. Must already be declared.
expranyYes—Right-hand side; combined with the existing value via the implied operator.

Returns

void

Example

compound-assignment
var int count = 0for i = 0 to 9    count += 1 // Equivalent to:// count := count + 1

Names and aliases

Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.

AlertaScript

No results found.

Search by name, alias, or keyword.