mon_pacey8
asked on
<cfoutput> problem in <cfloop>
I have a code below. Just a preview of my problem
<!---
If i have a variable value for exmple for accntNo1 to accntNo10 base after form submission
--->
accntNo1 = 'hello'
accntNo2 = 'hello2'
....
accntNo10 = 'hello10'
<!---
Then i loop the idx from 1 to max or in this example 10
--->
<cfloop index="idx" from="1" to="max">
<!---
tmp_var will generate accntNo1 based on first loop
so...
tmp_var = accntNo1
--->
<cfset tmp_var = 'accntNo#no#'>
<cfif IsDefined('tmp_var')>
<cfset tmp_dval = #tmp_var#>
<cfelse>
<cfset tmp_dval = "">
</cfif>
</cfloop>
<!---
Then I just want that the tmp_dval must equal to accntNo1
w/c is 'hello' declared above for example.
But the tmp_dval resulted into 'accntNo1'
Hope someone can help
--->
<!---
If i have a variable value for exmple for accntNo1 to accntNo10 base after form submission
--->
accntNo1 = 'hello'
accntNo2 = 'hello2'
....
accntNo10 = 'hello10'
<!---
Then i loop the idx from 1 to max or in this example 10
--->
<cfloop index="idx" from="1" to="max">
<!---
tmp_var will generate accntNo1 based on first loop
so...
tmp_var = accntNo1
--->
<cfset tmp_var = 'accntNo#no#'>
<cfif IsDefined('tmp_var')>
<cfset tmp_dval = #tmp_var#>
<cfelse>
<cfset tmp_dval = "">
</cfif>
</cfloop>
<!---
Then I just want that the tmp_dval must equal to accntNo1
w/c is 'hello' declared above for example.
But the tmp_dval resulted into 'accntNo1'
Hope someone can help
--->
Try this <cfset tmp_var = Evaluate("accntNo#no#")>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.