That's basically what the "example" variable in my demo code does - you have to set it outside of the inner loop.
So is this a confirmed bug or anything? > I have seen it before, not sure why it happens but what I did > to solve it was set a temp variable to hold the first element of > the query and reset it when it changes. > > <cfset tempvar = ''> > <cfoutput query="myQuery"> > <cfif tempvar NEQ myQuery.Value1> > <cfset tempvar = myQuery.Value1> > </cfif> > .... > ... > > > >>> [EMAIL PROTECTED] 03/27/03 12:04PM >>> > I don't know if any of you have run into this before or if it's even > been > mentioned (couldn't find it at mm technotes either), but I've run into > a > situation where the values of an outer loop referred to in an inner > loop > are not what you expect. I was burned on this recently and remember > vaguely it happening to me before. I've written some demonstration code > to > illustrate: > > http://www.simplemessageboard.com/loopbug.cfm > > The solution as shown in the code is to set a local variable BEFORE > you > begin the inner loop to hold the value of the outer loop you want to > refer > to within the inner loop. > > Anyone had this happen? Or is this expected behavior that I can't see? > > BTW, this is CF5, I don't know about MX. > > > Tony Schreiber, Senior Partner Man and Machine, > Limited > mailto:[EMAIL PROTECTED] > http://www.technocraft.com > > http://www.is300.net The Enthusiast's Home of the Lexus IS300 since > 1999 > http://www.simplemessageboard.com Free Forum Software for Cold > Fusion > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4