Hi All!
It is probably an easy one for a CF programmer, but I am switching over from ASP and having a hard time with this.
I know this code is bad. It suppose to fill Query String variables into an array where the variable names are Data1, Data2, Data3... Data10 and list them, on screen. What do I need to put into the underlined area or is it even possible in ColdFusion to do it this way?
<CFSET DataT=ArrayNew(1)>
<CFLOOP index="i" from="1" to="10">
<CFSET Datas="Data" & i>
<CFIF IsDefined("Form." & Datas)>
<CFSET DataT=Form.____>
<CFELSE>
<CFSET DataT="">
</CFIF>
<cfoutput>
#DataT#
</cfoutput>
</CFLOOP>
It is probably an easy one for a CF programmer, but I am switching over from ASP and having a hard time with this.
I know this code is bad. It suppose to fill Query String variables into an array where the variable names are Data1, Data2, Data3... Data10 and list them, on screen. What do I need to put into the underlined area or is it even possible in ColdFusion to do it this way?
<CFSET DataT=ArrayNew(1)>
<CFLOOP index="i" from="1" to="10">
<CFSET Datas="Data" & i>
<CFIF IsDefined("Form." & Datas)>
<CFSET DataT=Form.____>
<CFELSE>
<CFSET DataT="">
</CFIF>
<cfoutput>
#DataT#
</cfoutput>
</CFLOOP>