RE: Dynamic Structs
u have to do an evaluate. look at it this way. let's say i want to output Form variables (which already have values) dynamically. Let's say Form.Item1 = "hi" Form.Item2 = "how" and Form.Item3 = "who". u must use the EVALUATE function CFOUTPUT CFLOOP index="number" from=1 to=3 Evaluate('Form.Item' number)br /CFLOOP /CFOUTPUT u get... hi how who -Original Message- From: Ruslan Sivak [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 10:34 AM To: CF-Talk Subject: Dynamic Structs I'm trying to create a dynamic struct. I have something like this CFSET form.session_prefix="somestring." CFOUTPUTIs It Defined - #IsDefined("Session.#form.session_prefix#selected_locations")#/CFOUTPUT CFIF NOT isDefined("Session.#form.session_prefix#selected_locations") CFSET dummy=SetVariable("Session.#form.session_prefix#selected_locations",StructNe w()) /CFIF CFOUTPUT Is it a Struct - #IsStruct("Session.#form.session_prefix#selected_locations")# /CFOUTPUT It prints out: Is It Defined - NO Is it a Struct - NO Whey doesn't it create the struct properly? Ruslan Sivak Technologist ~~ 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
RE: Dynamic Structs
Where would I have to use an evaluate? I though most of these evaluated automatically? -Original Message- From: Phoeun Pha [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 12:28 PM To: CF-Talk Subject: RE: Dynamic Structs u have to do an evaluate. look at it this way. let's say i want to output Form variables (which already have values) dynamically. Let's say Form.Item1 = "hi" Form.Item2 = "how" and Form.Item3 = "who". u must use the EVALUATE function CFOUTPUT CFLOOP index="number" from=1 to=3 Evaluate('Form.Item' number)br /CFLOOP /CFOUTPUT u get... hi how who -Original Message- From: Ruslan Sivak [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 22, 2001 10:34 AM To: CF-Talk Subject: Dynamic Structs I'm trying to create a dynamic struct. I have something like this CFSET form.session_prefix="somestring." CFOUTPUTIs It Defined - #IsDefined("Session.#form.session_prefix#selected_locations")#/CFOUTPUT CFIF NOT isDefined("Session.#form.session_prefix#selected_locations") CFSET dummy=SetVariable("Session.#form.session_prefix#selected_locations",StructNe w()) /CFIF CFOUTPUT Is it a Struct - #IsStruct("Session.#form.session_prefix#selected_locations")# /CFOUTPUT It prints out: Is It Defined - NO Is it a Struct - NO Whey doesn't it create the struct properly? Ruslan Sivak Technologist ~~ 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
re: dynamic structs
Evaluate('Form.Item' number)br Why not just Form["Item#number#"] ? Should be faster than evaluate, and a bit easier to read. -Ray Camden ~~ 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