Increasing or Decreasing the Value of a Variable
You can use the increment or decrement operator in the following ways:
Before a variable. Siebel eScript modifies the variable before it uses it in a statement.
After a variable. Siebel eScript modifies the variable after it uses it in a statement.
These operators add or subtract 1 from a value. For example, i++ is shorthand for i = i + 1.
To increment or decrement a variable
To add 1 to a variable, you use the following operator:
++
To subtract 1 from a variable, you use the following operator:
--
The following example uses increment and decrement operators:
var i;
var j;
i = 4; //i is 4
j = ++i; //j is 5 and i is 5. Siebel eScript incremented i first.
j = i++; //j is 5, i is 6. Siebel eScript incremented i last.
j = --i; //j is 5, i is 5. Siebel eScript incremented i first.
j = i--; //j is 5, i is 4 Siebel eScript incremented i last.
i++; //i is 5. Siebel eScript incremented i.