This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Used to sum two numbers or concatenate two strings.
Syntax
result = expression1 + expression2
The + operator syntax has these parts:
| Part | Description |
| result | Any variable. |
| expression1 | Any expression. |
| expression2 | Any expression. |
Returns
N/A
Remarks
Although you can also use the + operator to concatenate two character strings, you should use the & operator for concatenation to eliminate ambiguity and provide self-documenting code.
When you use the + operator, addition or string concatenation will occur based on result type:
| If | Then |
| Result is numeric | Add |
| Result is string | Concatenate |
Restrictions
See also
Examples
DIM MyString AS STRING
DIM MyNumber AS LONG
'Results will be the string '123'
MyString = 1 + 2 + 3
MyString = 1 & 2 & 3
'Result will be the number 6
MyNumber = 1 + 2 + 3