The concatenation operator is the period (.). The concatenation operator forms a new string composed of two values. Variable conversion is handled automatically.

Note:

In the pattern block of a rule, a period is not an operator that concatenates two strings. It forces two patterns to match together, as described in Chapter 4, “Pattern Matching and Filters.”.

For example, in this script, four variables are assigned values. The first concatenation occurs within the first print statement. The second concatenation is a combination of two numbers and is assigned to the variable c. The new string represents a number and can be used in calculations.

ASL Script (concat_do.asl):
START 
do {
 a = 657;
 b = 9283;
 x = “cat”;
 y = ”dog”;
 print(x.y);
 c = a.b;
 print(c);
 stop();
}
Output:
$ sm_adapter concat_do.asl
catdog
6579283
$