User Guide

&&, + (concatenation operator) 599
Avoid this problem by placing parentheses around the entire phrase that includes an operator.
The parentheses clear up Lingos confusion by changing the precedence by which Lingo deals
with the operator, causing Lingo to treat the two parts of the argument as one complete
argument.
Example
This statement concatenates the strings “abra” and “cadabra” and displays the resulting string in
the Message window:
-- Lingo syntax
put("abra" & "cadabra")
// JavaScript syntax
put("abra" + "cadabra");
The result is the string “abracadabra”.
This statement concatenates the strings “$” and the content of the
price variable and then
assigns the concatenated string to the Price field cast member:
-- Lingo syntax
member("Price").text = "$" & price
// JavaScript syntax
member("Price").text = "$" + price;
&&, + (concatenation operator)
Usage
-- Lingo syntax
expression1 && expression2
// JavaScript syntax
expression1 + expression2
Description
String operator; concatenates two expressions, inserting a space character between the original
string expressions. If either
expression1 or expression2 is a number, it is first converted to a
string. The resulting expression is a string.
This is a string operator with a precedence level of 2.
Example
This statement concatenates the strings “abraand “cadabra” and inserts a space between the two:
-- Lingo syntax
put("abra" && "cadabra")
// JavaScript syntax
put("abra " + "cadabra");
The result is the string “abra cadabra”.