title: How can I #evaluate a Velocity Variable within a logic statement?
body: <p>I am using Apache Velocity templates. </p>
  
  <p>In the following I loop from 1..n and expect <code>$myVar</code> to be equal to a concatenation of the value of <code>$originalVar</code> and '_n' (where n is a number from 1..n) e.g. 'test_1' where 'test' is the value of <code>$originalVar</code> and 1 is the value of <code>n</code>.</p>
  
  <p>This can be achieved as follows :</p>
  
  <pre><code>#foreach($i in [1 .. $num_of_iterations])
      #set($myVar= "$originalVar_$i")
      #evaluate($myVar)
  #end
  </code></pre>
  
  <p>However, I am unable to #evaluate within a logic statement as per below:</p>
  
  <pre><code>#if (#evaluate($myVar)  == "false")
      ...
  #end
  </code></pre>
  
  <p>Therefore, how can I <code>#evaluate</code> a variable within a logic statement?</p>