How do I access a variable whose name is contained within another variable?<br><br>ie.<br>a variable named #variable# whose value is another variable name.<br>
In the following example I assign names of fields from a form to a list and then loop through the list to obtain and print the values.<br><br><br><cfset stringVars="frm_coy,frm_address,frm_inst,frm_link"><br><cfoutput><br><cfloop index="lfld" list="#VARIABLES.stringVars #" delimiters=","><br> <cfset tVal=#evaluate(lfld)#><br> #lFld# = #VARIABLES.tVal#<br></cfloop><br></cfoutput><br><br>HTH
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.