I just did a wee test, and - rather surprisingly to me - the currentRow
value seems to stick correctly when looping over a query and whilst
doing that, passing it lock-stock into another method.
CALLER.CFM
<cfscript>
q = queryNew("col");
for (i=1; i le 10; i=i+1){
queryAddRow(q);
querySetCell(q, "col", chr(64+i));
}
o = createObject("component", "c1");
q2 = o.f1(q);
writeOutput("#q2.currentRow# [although now it's reset]<br />");
</cfscript>
C1.CFC
<cfcomponent>
<cffunction name="f1" output="true">
<cfargument name="q">
<cfset var o = createObject("component", "c2")>
<cfloop query="arguments.q" startrow="3" endrow="8">
<cfoutput>f1: #arguments.q.currentRow#<br
/></cfoutput>
<cfset o.f2(arguments.q)>
<hr />
</cfloop>
<cfreturn arguments.q>
</cffunction>
</cfcomponent>
C2.CFC
<cfcomponent>
<cffunction name="f2" output="true" returntype="void">
<cfargument name="q">
<cfoutput>f2: #arguments.q.currentRow# [Note that it's
the same value as the calling iteration]<br /></cfoutput>
</cffunction>
</cfcomponent>
OUTPUT:
f1: 3
f2: 3 [Note that it's the same value as the calling iteration]
f1: 4
f2: 4 [Note that it's the same value as the calling iteration]
f1: 5
f2: 5 [Note that it's the same value as the calling iteration]
f1: 6
f2: 6 [Note that it's the same value as the calling iteration]
f1: 7
f2: 7 [Note that it's the same value as the calling iteration]
f1: 8
f2: 8 [Note that it's the same value as the calling iteration]
1 [although now it's reset]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]