decorative banner

Previous | Next               Table Of Contents > 2 Working with string and numeric variables > 2.3 Incrementing and decrementing numeric variables

2.3 Incrementing and decrementing numeric variables


The increment command and decrement commands can be used to increment or decrement a numeric variable by 1.

The syntax is

increment <variable>;

decrement <variable>;

Some examples are

setvar ~my_num, 4;

increment ~my_num; #value of ~my_num is now 5

decrement ~my_num; #value of ~my_num is now 4


Previous | Next