8.3.13 + operator (concatenate strings)
- Purpose
-
Performs string concatenation on two expressions.
- Syntax
Result = Expression1 + Expression2
- Arguments
-
- Result
-
Specify a variable for storing the result.
- Expression1
-
Write any expression.
- Expression2
-
Write any expression.
- Description
-
The action of the + operator depends on the internal processing of the two expressions, as follows.
Condition
Operation performed
Both expressions are strings.
String concatenation
Both expressions are numbers.
Addition
Both expressions are strings consisting entirely of numbers.
Addition#
One expression is a number, and the other is a string.
String concatenation
One expression is a string, and the other is a string consisting entirely of numbers.
String concatenation
One expression is a number, and the other is a string consisting entirely of numbers.
Addition
If both expressions are Empty values, the number 0 is set in Result. However, if only one of the expressions is an Empty value, the other expression is returned as is in Result.
- #
-
Use the & operator to concatenate strings.
- Note
-
When Result and Expression1 are the same variable, you can use the += operator instead.
- Examples
' This codes stores "ABCDEF" in variable result1. result1 = "ABC" + "DEF" ' This codes stores 12 in variable result2. result2 = 7 + 5
- JP1/Script version
-
Supported from JP1/Script 01-00.