Hey guys, im posting this to see if anyone else sees this as a bug. I have had a few people verify that Im not losing my mind, but just want to see if everyone agrees that this is not expected behavior.
Take the following code and run it: ====start code==== <cfset queryAddRow(variables.queryOne) /> <cfset querySetCell(variables.queryOne,"colA","a") /> <cfset queryAddRow(variables.queryOne) /> <cfset querySetCell(variables.queryOne,"colA","b") /> <cfset queryAddRow(variables.queryOne) /> <cfset querySetCell(variables.queryOne,"colA","c") /> <cfset queryAddRow(variables.queryOne) /> <cfset querySetCell(variables.queryOne,"colA","d") /> <cfset queryAddRow(variables.queryOne) /> <cfset querySetCell(variables.queryOne,"colA","e") /> <cfdump var="#variables.queryOne#" /> <cfset variables.queryTwo = queryNew("col1") /> <cfset queryAddRow(variables.queryTwo) /> <cfset querySetCell(variables.queryTwo,"col1","6") /> <cfset queryAddRow(variables.queryTwo) /> <cfset querySetCell(variables.queryTwo,"col1","7") /> <cfset queryAddRow(variables.queryTwo) /> <cfset querySetCell(variables.queryTwo,"col1","8") /> <cfset queryAddRow(variables.queryTwo) /> <cfset querySetCell(variables.queryTwo,"col1","9") /> <cfset queryAddRow(variables.queryTwo) /> <cfset querySetCell(variables.queryTwo,"col1","0") /> <cfdump var="#variables.queryTwo#" /> <cfloop query="variables.queryOne"> <br /> Outside Loop:<cfdump var="#variables.queryOne.colA#" />=<cfdump var="#variables.queryOne.currentRow#" />, <br /> Inside Loop: <cfloop query="variables.queryTwo"> <cfdump var="#variables.queryOne.colA#" />=<cfdump var="#variables.queryOne.currentRow#" />, </cfloop> </cfloop> ====end code==== You should see two query dumps, and then some output in text at the bottom. If you look at the code, you will see that on the inner loop, it pulls the correct currentRow from the outer loop, but not the correct value. The value, inside of the inner loop is always a, even though the currentRow changes. A workaround is to use #variables.queryOne.colA[variables.queryOne.currentRow]# in the inside loop, or, to use <cfloop from="1" to="#variables.queryOne.recordCount#" index="i"> for the inner loop, but can we agree that you should not need to do either of those? Can we agree that with the code above, the expected output would be: Outside Loop: a = 1 , Inside Loop: a = 1 , a = 1 , a = 1 , a = 1 , a = 1 , Outside Loop: b = 2 , Inside Loop: b = 2 , b = 2 , b = 2 , b = 2 , b = 2 , Outside Loop: c = 3 , Inside Loop: c = 3 , c = 3 , c = 3 , c = 3 , c = 3 , Outside Loop: d = 4 , Inside Loop: d = 4 , d = 4 , d = 4 , d = 4 , d = 4 , Outside Loop: e = 5 , Inside Loop: e = 5 , e = 5 , e = 5 , e = 5 , e = 5 , What do you just think? -- Ryan Guill BlueEyesDevelopment [EMAIL PROTECTED] www.ryanguill.com (270) 217.2399 got google talk? Chat me at [EMAIL PROTECTED] The Coldfusion Open Application Library - COAL - http://coal.ryanguill.com Use CF and SQL? Try qBrowser - http://www.ryanguill.com/docs/ www.ryanguill.com/ The Roman Empire: www.ryanguill.com/blog/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234042 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54