title: How can I test that a value is within a range with a "case" statement instead of an "if" statement?
body: <p>Can the following if statement be converted to a case statement?</p>
  
  <pre><code>if (Number &gt;= 5) and (Number &lt;= 10) then
    lblAnswer.Caption := 'in range'
  else
    lblAnswer.Caption := 'out of range';
  </code></pre>
  
  <hr>
  
  <p>My Answer :</p>
  
  <p>Yes it can </p>
  
  <pre><code>case (number &gt;= 5) and (Number &lt;= 10) of
    lblAnswer.Caption := 'in range';
    lblAnswer.Caption := 'out of range';
  end;
  </code></pre>
  
  <p>Is this correct?</p>