ADD
Top  Previous  Next

ADD !VAR1 value
   
Add a value to !VAR1. 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. This command is related to the SET command.

Note: Double-brackets are used around a variable when you mean the value of the variable. No brackets are used when you mean the variable itself. Thus ADD !VAR1 {{!LOOP}} means: Add the value of the !LOOP variable to the variable !VAR1.

Example 1:
SET !VAR1 100
ADD !VAR1 -20

=> Content of !VAR1 is 80

Example 2:
SET !VAR1 Hello
ADD !VAR1 <SP>World<SP>
ADD !VAR1 2010

=> Content of !VAR1 is "Hello World 2010"

Note: You can use the PROMPT command to display variable values.





Page URL http://www.iopus.com/imacros/help/add.htm