AND INDEX

AND _ _ _ _ _ _ _ _ _ _ _ _ operator

The and binary logical operator returns true if both of its arguments are true.

syntax:

<logical\_expression> and <logical\_expression>

<logical\_expression> must evaluate to true or nil.

examples:


a := 12; 

  A := 12 


if numberp a and a < 15 then write a**2 else write "no";
 


  144 


clear a; 

if numberp a and a < 15 then write a**2 else write "no";
 


  no

Logical operators can only be used inside conditional statements, such as while...do or if...then...else. and exami nes each of its arguments in order, and quits, returning nil, on finding an argument that is not true. An error results if it is used in other contexts.

andis left associative: x and y and z is equivalent to (x and y) and z.