<cfloop array="#users#" index="user">
</cfloop>
<cfloop collection="#users#" item="i">
<cfset user = users[i] />
</cfloop>
<cfloop query="users">
<!--- convert the row into a struct in order to access all the user's data in a single collection --->
<cfset user = {} />
<cfloop list="#users.columnList#" index="i">
<cfset user[i] = users[i][currentRow] />
</cfloop>
</cfloop>
I really wish I could do...
<cfloop collection="#users#" index="user">
</cfloop>
<cfloop query="#users#" index="user">
</cfloop>
... but that might make too much sense.
Seriously, someone just needs to take all the nice parts of ColdFusion and re-write the damn language. It would make me so much happier. Also, don't get me started on the lack of #'s in cfloop query.
Switch to railio, they were able to go from the ground up and is so much faster, but I would blame the CFML folks that decide how the language should work
ReplyDeleteAlso, I want to be able to loop using data="#users#" index="user" without having to specify array/collection/query since ColdFusion should be able to figure how how to handle it.
ReplyDeleteWaiting for For...in loop array support in CFScript in CF9.0.1
ReplyDelete