How about

<cfset thelist = "">
<cfloop from="1" to="3" index="id">
        <cfset thelist = ListAppend(thelist, Evaluate("form.fieldnum#id#"))>
</cfloop>

Nick

-----Original Message-----
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 24, 2001 4:23 PM
To: CF-Talk
Subject: Dynamic variable names


Can you have dynamic variable names in CF?....e.g in an action page could
you have something like - 

<cfset thelist = "">
<cfloop from="1" to="3" index="id">
        <cfset thevalue = Evaluate(form.fieldnum & "#id#")>
        <cfset thelist = ListAppend(thelist, thevalue)>
</cfloop>

where there are form fileds fieldnum1, fieldnum2, and fieldnum3.

I have tried this but it doesn't work.....I thought you might be able to use
the Evaluate function in this way as this works (from the Forta book):

<cfset x = "Array">
<cfset EVALUATE("p = " & x & "New(1)")>

This creates a new array stored in the variable p


**********************************************************************
Information in this email is confidential and may be privileged. 
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system. 
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone. 
Thank you for your co-operation.
**********************************************************************

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to