Stas,
If you knew that you had a series of variables in a specific structure it
would be pretty easy to grab them. You need to use the evaluate()
function...
for the following structure you could do something linke this:
session.delivery.rush
session.delivery.standard
session.delivery.economy
--- start ---
<cfscript>
// Lets find out the names of the variables...
varlist = structKeyList(session.delivery);
</cfscript>
<!--- Lets output the variables... --->
<cfloop list="#varlist#" index="i">
<cfoutput>#evaluate("session.delivery.#i#")#</cfoutput>
</cfloop>
The syntax might not be perfect but you should get the idea.
Chris Cortes
Consultant
[EMAIL PROTECTED]
Direct 713-985-6244
Cell 832-723-6485
Stonebridge Technologies
...The Fast Track to e-Business.
visit us at www.sbti.com
----- Original Message -----
From: "Stas Newdel" <[EMAIL PROTECTED]>
To: "CFTalk" <[EMAIL PROTECTED]>
Sent: Thursday, September 14, 2000 12:55 PM
Subject: dynamic variable label creation
> Hello,
>
> I am creating a form on the fly, and on the action page I am trying to
> create session variables like this:
>
> <cfloop index="priority_label" list="#fieldnames#">
> <cfif ListFirst(priority_label, "_") eq "priority">
> <cfset priority = ListLast(priority_label, "_")>
> <cfset session.delivery.#priority# = Evaluate(priority_label)>
> </cfif>
> </cfloop>
>
> so if three form vars were passed: priority_rush, priority_standard,
> priority_economy, I want to create three session variables named:
>
> session.delivery.rush
> session.delivery.standard
> session.delivery.economy
>
> and assign corresponding values to them. How would I do that? Thanks! (My
> syntax is obviously incorrect).
>
> --------------------------------------------------------------------------
----
> 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.