Jon Jagger
jon@jaggersoft.com
Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specificationpreviousnextprevious at this levelnext at this level 15 Statementsprevious at this levelnext at this level 15.7 Selection statementsprevious at this levelnext at this level 15.7.1 The if statement Paragraph 11 The if statement selects a statement for execution based on the value of a boolean expression. if-statement : if ( boolean-expression ) embedded-statement if ( boolean-expression ) embedded-statement else embedded-statement boolean-expression : expression Paragraph 21 An else part is associated with the lexically nearest preceding if that is allowed by the syntax. [Example: Thus, an if statement of the form
if (x) if (y) F(); else G();  
is equivalent to
if (x) {  
   if (y) {  
      F();  
   }  
   else {  
      G();  
   }  
}  
end example]
Paragraph 31 An if statement is executed as follows: Paragraph 41 The first embedded statement of an if statement is reachable if the if statement is reachable and the boolean expression does not have the constant value false. Paragraph 51 The second embedded statement of an if statement, if present, is reachable if the if statement is reachable and the boolean expression does not have the constant value true. Paragraph 61 The end point of an if statement is reachable if the end point of at least one of its embedded statements is reachable. 2 In addition, the end point of an if statement with no else part is reachable if the if statement is reachable and the boolean expression does not have the constant value true.
{ JSL }
Jagger Software Ltd
Company # 4070126
VAT # 762 5213 42
Valid HTML 4.01Valid CSS