Add a value to a variable. You can also substract values by adding a negative value to the variable. If the content of at least one of the variables is not numeric, the values are concatenated as strings instead. The ADD command supports the built-in variables !VAR1, !VAR2, !VAR3 and !EXTRACT.
Syntax
ADD result_var added_value
Parameters
result_var
One of the four built-in variables !VAR1, !VAR2, !VAR3 or !EXTRACT. After the ADD command, this variable will hold the result.
added_value
The value that will be added to result_var
Examples
Both values are numeric, therefore the result is numeric as well:
SET !VAR1 100
ADD !VAR1 -20
=> Content of !VAR1 is 80.
At least one of the values is a string, therefore the result is a string as well:
SET !VAR1 Hello
ADD !VAR1 <SP>World<SP>
ADD !VAR1 2010
=> Content of !VAR1 is Hello World 2010
See Also
SET
Page URL http://www.iopus.com/imacros/help/cmd_add.htm