Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

##variable##

Status
Not open for further replies.

wessto

Programmer
Jul 5, 2000
1
US
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>&lt;cfset stringVars=&quot;frm_coy,frm_address,frm_inst,frm_link&quot;&gt;<br>&lt;cfoutput&gt;<br>&lt;cfloop index=&quot;lfld&quot; list=&quot;#VARIABLES.stringVars #&quot; delimiters=&quot;,&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;cfset tVal=#evaluate(lfld)#&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;#lFld# = #VARIABLES.tVal#<br>&lt;/cfloop&gt;<br>&lt;/cfoutput&gt;<br><br>HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top