FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

if()

   
Examples  
for(int i=5; i<height; i+=5) { 
  stroke(255);  //Set the color to white 
  if(i < 35) {  //When "i" is less than "35"... 
    stroke(0);  //...set the color to black 
  } 
  line(30, i, 80, i); 
} 
Description   Allows the program to make a decision about which code to execute. If the expression evaluates to true, the statements enclosed within the block are executed and if the expression evaluates to false the statements are not executed.
   
Syntax  
if(expression) { 
  statements 
} 
   
Parameters  
expression   any valid expression that evaluates to true or false

statements   one or more statements to be executed

   
Usage   Web & Application
   
Related   else
 
 






   
 
Updated: Fri Jul 15 16:35:41 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info