How do I use INC Statement?

The increment statement allows you to increment a variable or attribute’s value. It adds one (the default) or more to the value of the variable or attribute.


INC name [, expression]

name This is the name of the variable or attribute to be incremented.

[expression] You can optionally increment the variable or attribute by more than one using an expression which can be a constant or a mathematical expression. The name and expression must be separated by a comma. (The square brackets illustrate only that this element is optional.)


The following are several easy-to-understand examples. The first increments the value of v_ Var1 by one. The second increments the value of a_ Attr1 by five. And the third increments the value of v_ Number_in_System by the value of v_ Num_Processed plus one.

1) INC v_Var1
2) INC a_Attr1, 5
3) INC v_Number_in_System, v_Num_Processed +1

Logic Statements:

Was this article helpful?

Related Articles