I got it to work like this:

<cfset session.delivery = structnew()>

<cfloop index="priority_label" list="#fieldnames#">
        <cfif ListFirst(priority_label, "_") eq "priority">
                <cfset priority = ListLast(priority_label, "_")>
                <cfset my_value = Evaluate (priority_label)>
                <cfset result = structinsert(session.delivery,priority,my_value)>
        </cfif>
</cfloop>

-----Original Message-----
From: Charles A. Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 14, 2000 4:42 PM
To: [EMAIL PROTECTED]
Subject: Re: dynamic variable label creation


At 10:55 AM 9/14/00 , you wrote:
>... creating a form on the fly,
>create session variables like this:
>
><cfloop index="priority_label" list="#fieldnames#">
>...[snip]
></cfloop>
>...

Dynamic variables must be a common problem. I tried coding this as a
variable within a variable and it didn't work.

<CFLOOP INDEX="memberindex" FROM="2" TO="#val(memberloop)#" STEP="1">
Member #memberindex# Name: #Member###memberindex###FirstName#
#Member###memberindex###MiddleName#. #Member###memberindex###LastName#

The compiler gagged on the non-existent "Member" variable (center of second
line before ###) instead of concatenating the variable's three pieces to
read it as something like #Member14FirstName#

So what's the secret syntax, gang?   8-)

Charles A. Lee
http://www.psn.net/~calee

Webmaster, Tucson Computer Society
http://www.aztcs.org

===============================
= For a real sponge cake,     =
= borrow all the ingredients. =
===============================

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to