INCR & DECR

Introduced in LDPL 3.0.5 - Creative Carnotaurus

The INCR and DECRstatements add or subtract from a NUMBER variable by one. The variable is updated with the new value in place.

Syntax:

INCR <NUMBER-VAR>
DECR <NUMBER-VAR>

Example:

DATA:
x is number
PROCEDURE:
STORE 0 IN x
WHILE x IS LESS THAN 5 DO
DISPLAY "x: " x crlf
INCR x
REPEAT

Outputs:

x: 0
x: 1
x: 2
x: 3
x: 4