User Guide
contains 611
and
Usage
-- Lingo syntax
logicalExpression1 and logicalExpression2
// JavaScript syntax
logicalExpression1 && logicalExpression2
Description
Logical operator; determines whether both logicalExpression1 and logicalExpression2 are
TRUE (1), or whether either or both expressions are FALSE (0).
The precedence level of this logical operator is 4.
Example
This statement determines whether both logical expressions are TRUE and displays the result in the
Message window:
-- Lingo syntax
put(1 < 2 and 2 < 3)
// JavaScript syntax
put((1 < 2) && (2 < 3));
The result is 1, which is the numerical equivalent of TRUE.
The first logical expression in the following statement is
TRUE; and the second logical expression is
FALSE. Because both logical expressions are not TRUE, the logical operator displays the result 0,
which is the numerical equivalent of
FALSE.
-- Lingo syntax
put(1 < 2 and 2 < 1)
-- 0
// JavaScript syntax
put((1 < 2) && (2 < 1));
// 0
See also
not, or
contains
Usage
-- Lingo syntax
stringExpression1 contains stringExpression2
// JavaScript syntax
stringExpression1.indexOf(stringExpression2);
Description
Operator; compares two strings and determines whether stringExpression1 contains
stringExpression2 (TRUE) or not (FALSE).
The
contains comparison operator has a precedence level of 1.