The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "ADD"
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | 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 | + | 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 an integer number, the values are concatenated as strings instead. The ADD command supports the built-in variables [[!VAR0]] through [[!VAR9]] and [[!EXTRACT]]. |
− | ===Syntax [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] [[Image:Ff-icon.png|Firefox]]=== | + | ===Syntax [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] [[Image:Ff-icon.png|Firefox]] [[Image:Cr-icon.png|Chrome]]=== |
ADD result_var added_value | ADD result_var added_value |
Revision as of 11:10, 14 June 2017
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 an integer number, the values are concatenated as strings instead. The ADD command supports the built-in variables !VAR0 through !VAR9 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
Data Extraction: Add a value to the internal !EXTRACT variable:
ADD !EXTRACT {{!COL1}}