Thanks for the explination. I understand the issue now. :)

Peter Boughton wrote:
>> I'm just using a cfoutput querry loop.
>>
>> But I put in [CurrentRow] just in case. No change. Still not working.
> 
> Not sure if you're understanding fully, so I'll simplify completely:
> (apologies if any of this is patronising)
> 
> This code here:
>     <cfoutput query="FAQ">
>         #Question#
>     </cfoutput>
> 
> Will do the same as this:
> 
>     <cfoutput query="FAQ">
>         #FAQ.Question[FAQ.CurrentRow]#
>     </cfoutput>
> 
> 
> If you did this:
> 
>     <cfoutput query="FAQ">
>         <cfset Variables.Question = "X"/>
>         #FAQ.Question[FAQ.CurrentRow]#
>     </cfoutput>
> 
> You wouldn't be surprised that the output didn't change (I hope).
> 
> 
> The following is IDENTICAL to ColdFusion as the above code:
> 
>     <cfoutput query="FAQ">
>         <cfset Variables.Question = "X"/>
>         #Question#
>     </cfoutput>
> 
> 
> And this code is also IDENTICAL to ColdFusion as both the above:
> 
>     <cfoutput query="FAQ">
>         <cfset Question = "X"/>
>         #Question#
>     </cfoutput>
> 
> 
> In other words, when you *set* the variable Question, it goes into the global 
> Variables scope.
> 
> However, when you *read* the variable Question, because you are looping 
> through the query, it looks first in the query's scope.
> 
> This is one of the reasons you find many people saying you should always 
> scope all variables - it avoids issues like this.
> 
> To make things work as you want, you need to either read the global Variables 
> scope, or instead to change the value within the query scope.
> 
> 
> All make sense? 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:313757
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to