Language \ Environment \ Comparison
 
Index
 
  The Processing 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: reas at groupc.net
Name  

&& (logical AND)

   
Examples  
for(int i=5; i<=95; i+=5) { 
  if((i > 35) && (i < 60)) { 
    stroke(0);    //Set color to black 
  } else { 
    stroke(255);  //Set color to white 
  } 
  line(30, i, 80, i); 
} 
Description   Compares two expressions and returns true only if both evaluate to true. Returns false if one or both evaluate to false. The following list shows all possible combinations:

true && false // Evaluates false because the second is false
false && true // Evaluates false because the first is false
true && true // Evaluates true because both are true
false && false // Evaluates false because both are false
   
Syntax  
expression1 && expression2
   
Parameters  
expression1   any valid expression

expression2   any valid expression

   
Usage   Web & Application
   
Related   || (logical OR)
! (logical NOT)
if()
   
© 2004 - 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea
Processing is an open project initiated by Ben Fry and Casey Reas