title: Count variables in a loop
body: <p>I want to count the variables and show it somewhere in my code. I have a loop:</p>
  
  <pre><code>&lt;cfloop query="get_serial"&gt;
    &lt;cfif PROCESS_ID eq attributes.action_id&gt; #SERIAL_NO# &lt;/cfif&gt;
  &lt;/cfloop&gt;
  </code></pre>
  
  <p>and its query:</p>
  
  <pre><code>&lt;cfquery name="get_serial" datasource="#dsn3#"&gt;
  SELECT * 
  FROM SERVICE_GUARANTY_NEW 
  WHERE STOCK_ID = #attributes.action_row_id# 
  ORDER BY SERIAL_NO
  &lt;/cfquery&gt;
  </code></pre>
  
  <p>Everything works fine, but I want to count how many variables are displayed exactly. I actually want to do it in this way because I lack of database variables. Actually it is possible to get the amount of these variables from database, I just don't know which variables to use. That is why I want to count it manually.</p>