title: How to set a dynamic key name in a struct?
body: <p>I am looping through a query and want to set the name of a struct key and its value dynamically. But I can't seem to get it to work because its not interpreting the dynamic value properly - it thinks its the actual name of the key. Here's what I mean</p>
  
  <pre><code>&lt;cfloop query="rsSettings"&gt;
   &lt;cfset APPLICATION.Config.Settings[rsSettings.CompanyID] = StructNew()&gt;
   &lt;cfset APPLICATION.Config.Settings[rsSettings.CompanyID].#rsSettings.Name#" = rsSettings.SettingValue/&gt;
  &lt;/cfloop&gt;
  </code></pre>
  
  <p>I need the <code>#rsSettings.Name#</code> part to be the name value stored in that recordset e.g. "MaxOrders"</p>
  
  <p>I tried putting quotes around it like this  <code>&lt;cfset APPLICATION.Config.Settings[rsSettings.CompanyID]."rsSettings.Name" = rsSettings.SettingValue/&gt;</code> but it doesn't work.</p>
  
  <p>What can I do to make it accept a dynamic key name?</p>