MorganGreylock
Programmer
I'm trying to do the following:
<CFLOOP From="1" TO="#Counter#" index="i">
<cfset tempcount = "NumMonth#i#">
<cfif tempcount EQ 2>
<CFSWITCH EXPRESSION="Month#i#">
<CFCASE VALUE="January">
<cfset "secondmonth#i#" = "February">
This is a test.<BR>
</CFCASE>
.....
Basically what I'm doing is this:
I've dynamically created select boxes on the previous page using the old Month#Counter# way.... So that generates Selects with the names of
Month1, Month2, etc (Unknown # of selects based on input). Now, i want to
get the data back out of those. The drop down lists contain months, but for
some options, it should be two months (January-February for example). On the
previous page, I set NumMonths = 1 or 2 to let me know on this page whether or not
I needed to add January, or January and February. (The months are the field names, and if its a two month stretch, I need to fill in the same data for both fields).
My problem is this: I have multiple NumMonths variables, (denoted NumMonths1, NumMonths2, etc), and I can't get to them. I tried using this: NumMonth#i#, and it gives me NumMonth1, NumMonth2, etc, but those themselves are variables containing January, March, July, etc. I need to evaluate those, and I can't seem to do it. In concept, this is what I want to do:
<cfset temp = NumMonths#i#>
<Cfset month = #temp#> <!--- at this point, 'month' would contain January --->
Any suggestions on this? I've been racking my brain for a while. I tried the Evaluate() function, and either it doesn't do it, or I didn't use it correctly.
Thanks in advance,
MG
<CFLOOP From="1" TO="#Counter#" index="i">
<cfset tempcount = "NumMonth#i#">
<cfif tempcount EQ 2>
<CFSWITCH EXPRESSION="Month#i#">
<CFCASE VALUE="January">
<cfset "secondmonth#i#" = "February">
This is a test.<BR>
</CFCASE>
.....
Basically what I'm doing is this:
I've dynamically created select boxes on the previous page using the old Month#Counter# way.... So that generates Selects with the names of
Month1, Month2, etc (Unknown # of selects based on input). Now, i want to
get the data back out of those. The drop down lists contain months, but for
some options, it should be two months (January-February for example). On the
previous page, I set NumMonths = 1 or 2 to let me know on this page whether or not
I needed to add January, or January and February. (The months are the field names, and if its a two month stretch, I need to fill in the same data for both fields).
My problem is this: I have multiple NumMonths variables, (denoted NumMonths1, NumMonths2, etc), and I can't get to them. I tried using this: NumMonth#i#, and it gives me NumMonth1, NumMonth2, etc, but those themselves are variables containing January, March, July, etc. I need to evaluate those, and I can't seem to do it. In concept, this is what I want to do:
<cfset temp = NumMonths#i#>
<Cfset month = #temp#> <!--- at this point, 'month' would contain January --->
Any suggestions on this? I've been racking my brain for a while. I tried the Evaluate() function, and either it doesn't do it, or I didn't use it correctly.
Thanks in advance,
MG