Right. Brad's syntax is better. :-) On Thu, Jan 8, 2009 at 10:13 AM, <[email protected]> wrote:
> You are trying to treat "guest" as a struct with a key called 1 through > 10. You want to concatenate the word guest with the number, and THAT > composite string is the name of the key in the guestdetail struct: > > <cfloop from="1" to="10" index="idx"> > Guest #idx#: #guestdetail["guest" & idx]#<br> > </cfloop> > > ~Brad > > -------- Original Message -------- > Subject: Loop and Variable Names > From: Les Mizzell <[email protected]> > Date: Thu, January 08, 2009 10:04 am > To: cf-talk <[email protected]> > > I always seem to get this wrong. > > For query results fields guestdetail.guest1 to guestdetail.guest10, why > isn't the following working? > > <cfloop from="1" to="10" index="idx"> > Guest #idx#: #guestdetail.guest[idx]#"<br> > </cfloop> > > ....at least I'm not using evaluate! > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317610 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

