I don't know if anyone's run into construct problems when trying to set
dynamic structure variables on the fly.

I'm creating a structure, other["key"]=value but I want to set the whole
thing on the fly.

For example this works:

<CFSET other["#suboption#"]=evaluate("#option#_contents")>


But this doesn't:
<CFSET option="other">
<CFSET #option#["#suboption#"]=evaluate("#option#_contents")>

Nor: 
<CFSET "#option#["#suboption#"]"=evaluate("#option#_contents")>
<CFSET ""#option#["#suboption#"]""=evaluate("#option#_contents")>
<CFSET "#option#[""#suboption#""]"=evaluate("#option#_contents")>
<CFSET '#option#["#suboption#"]'=evaluate("#option#_contents")>
<CFSET "#option#['#suboption#']"=evaluate("#option#_contents")>
<CFSET "#evaluate("#option#["#suboption#"]")"=evaluate("#option#_contents")>
<CFSET
"#evaluate("#option#[#chr(34)##suboption##chr(34)#]")"=evaluate("#option#_co
ntents")>

Any ideas on how to set the structure other["#suboption#"]

I've included the whole context which this structure is being set in....

Orlando Correa
IHS Web Team
Web Applications Developer, DBA
http://my.ihs.gov

    <CFSWITCH expression = "#option#">
      <CFCASE value="other">

        <CFSWITCH expression = "#suboption#">
          
          <CFCASE value="1"><CFSET
filename="what_is_a_control_chart.htm"></CFCASE>
          <CFCASE value="2"><CFSET filename="stats.htm"></CFCASE>
          <CFCASE value="3"><CFSET filename="sample.htm"></CFCASE>      
          <CFCASE value="4"><CFSET
filename="core_measures_implementation_plan.htm"></CFCASE>

          <CFDEFAULTCASE><CFSET
filename="what_is_a_control_chart.htm"></CFDEFAULTCASE>          
        </CFSWITCH>

        <CFIF NOT IsDefined("application.#option#")>
          <CFSET "#option#"=StructNew()>
        <CFELSE>
          <CFSET "#option#"=evaluate("application.#option#")>          
        </CFIF>

        <CFIF NOT StructKeyExists(other,suboption) OR
IsDefined("cachetime")>
          <CFLOCK NAME="read_#option#" TIMEOUT="60">
            <CFFILE ACTION="READ" FILE="#dirpath##option#\#filename#"
VARIABLE="#option#_contents">
          </CFLOCK>
          <CFSET
"#option#_contents"=replacelist(evaluate("#option#_contents"),"#chr(34)#imag
es","#chr(34)##option#/images")>
          <CFLOCK NAME="application_#option#" TIMEOUT="60">
            <CFSET
'#option#["#suboption#"]'=evaluate("#option#_contents")><!--- HERE's the
problem code --->
            <CFSET "application.#option#"=evaluate(option)>

         <CFOUTPUT>#evaluate("#option#_contents")#</CFOUTPUT>
          </CFLOCK>
        <CFELSE>
          <CFOUTPUT>#other["#suboption#"]##chr(13)##chr(10)#</CFOUTPUT>
        </CFIF> 


      </CFCASE>

      <CFDEFAULTCASE><!--- do nothing ---></CFDEFAULTCASE>

    </CFSWITCH>
  </CFCASE>
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to