Evaluates to true if both operands are true, false otherwise.Syntax:
<value1> and <value2>
Examples:
(1 > 0) and (1 = 0)
(1 > 0) and (1 = 1) and (0 = 0)
if the shiftKey is down and myCount > 1 then exit mouseUp
Use the and operator to combine two or more logical values.
If value1 is false or value2 is false, or if both value1 and value2 are false, then the and operation Evaluates to false. If value1 and value2 are both true, the expression value1 and value2 Evaluates to true. You can combine the logical operators and, or, and not in an expression.
LiveCode uses what is known as "short-circuit evaluation" for logical operators(glossary). This means that value1 is evaluated first. If value1 is false, the expression value1 and value2 is false regardless of what value2 is (because the expression evaluates(glossary) to false unless both the values are true). In this case, LiveCode does not evaluate value2, since doing so is not necessary to determine the value(function) of value1 or value2. For example, evaluating the expression asin(2) normally causes an execution error (because 2 is not a legal argument for the arc sine function), but evaluating the expression (1 = 0) and (asin(2) = 1) does not cause an error: since (1 = 0) is always false, the whole statement is always false and LiveCode never tries to evaluate the asin function.
Parameters:
- value1 (bool): The value1 and value2 are true or false, or expressions that evaluate totrue or false.
- value2:
- Description:Use the and operator to combine two or more logicalvalues.