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"
Jump to navigation
Jump to search
Line 8: | Line 8: | ||
===Parameters=== | ===Parameters=== | ||
* result_var | * result_var | ||
− | One of the four built-in variables !VAR1, !VAR2, !VAR3 or !EXTRACT. After the ADD command, this variable will hold the result. | + | *:One of the four built-in variables !VAR1, !VAR2, !VAR3 or !EXTRACT. After the ADD command, this variable will hold the result. |
* added_value | * added_value | ||
− | The value that will be added to result_var | + | *:The value that will be added to result_var |
===Examples=== | ===Examples=== |
Revision as of 07:36, 22 April 2007
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