title: the var keyword in coldfusion and how many times to use it
body: <p>I always try to make use of the var keyword when inside functions using CF, but one probably stupid question I have is, how often do you have to use it ?</p>
  
  <p>Example : </p>
  
  <pre><code>&lt;cfset var local = ""&gt; &lt;!-- set at the top of the function --&gt;
  
  &lt;!-- then later in the function --&gt;
  &lt;cfset var local.firstname = "steve"&gt;
  &lt;cfset var local.lastname = "smith"&gt;
  &lt;cfset var local.email = "email@email.com"&gt;
  </code></pre>
  
  <p>is it a case of every time you write a variable you have to set the keyword, or just the first instance of it when used within a function ?</p>
  
  <p>Or is it just the same as</p>
  
  <pre><code>&lt;cfset var local = ""&gt; &lt;!-- set at the top of the function --&gt;
  
  &lt;!-- then later in the function --&gt;
  &lt;cfset local.firstname = "steve"&gt;
  &lt;cfset local.lastname = "smith"&gt;
  &lt;cfset local.email = "email@email.com"&gt;
  </code></pre>