Increases the existing value of a numeric user variable with the given name (in the specified scope) by the given value.

This function may be useful for accumulating total sums. Basically, it is a shortcut of the following expression:

setVar(name, getVar(name).toNumber() + value)

Parameters:

scope

The scope (context) with which the variable is associated. (See "About User Variables" below.)

If this parameter is not specified, the global scope is assumed by default.

name
The variable name.

If no variable with that name existed before or the current variable value isn't numeric, the generator will show an error message.

value
Specify the numeric value to be added to the existing variable value.

Returns:

The new value assigned to the variable.

See Also:

setVar(), getVar(), getNumberVar(), toNumber()

${include ../../refs/user_vars.htm}