• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Conditional statements

Another staple frequently used in interactive technologies is the conditional statement. In a nutshell, the conditional statement executes code depending on whether one or more conditions are true. If the condition(s) are true, certain lines of code are executed; otherwise, different code is executed. You might think of a conditional statement as the proverbial fork in the road. Listing A Conditional Statement in Its Most Basic Form shows the basic structure of a conditional statement.

							A Conditional Statement in Its Most Basic Form
							
if (condition)
   {(action);
}else;
   {(else‐action);
}



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint