Sean A. Corfield:
"Agreed. It looks like odd behavior on the surface but CF has pretty
much always behaved that way as far as I know.
<cfloop query="outer">
.....
<cfset somevar = outer.somecol />
<cfloop query="inner">
..... reference somevar ...
</cfloop>
.....
</cfloop>
You can't reference outer.somecol directly inside the inner loop, you
have to use the intermediate variable even if the column names don't
conflict. Just one of CF's quirks..."
----------
Wow, I get to show something to Sean Corfield!
One can reference the outer query but one can not do it relying on the
generic current row. One has to fully qualify the outer query with its
own current row value, or some other row value that makes sense to what
one is trying to do.
<cfscript>
qryOne = queryNew("aField");
queryAddRow(qryOne,3);
for (i =1; i LT 4; i = i + 1)
{
querySetCell(qryOne,"aField",i,i);
}
qryTwo = queryNew("bField");
queryAddRow(qryTwo,4);
for (i=1; i LT 5; i = i + 1)
{
querySetCell(qryTwo,"bField",chr(randRange(65,90)),i);
}
</cfscript>
<cfloop query="qryOne">
<cfloop query="qryTwo">
<strong>#qryOne.aField[qryOne.currentRow]#</strong> #qryTwo.bField#
</cfloop>
</cfloop>
Confidentiality Notice: This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279113
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4