Title:
Bug 82892:(Watson Migration Closure)Summary: for (query)G’dayThis has come up before, but I cannae find an E/R for it
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 05/15/2010
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Major / Unknown
Locale/System: English / Platforms All
Vote Count: 7
Problem:
Summary: for (query)G’dayThis has come up before, but I cannae find an E/R for it.The more I code in CFScript, the more I realise one of the things I most often have to break out of the script block for is to iterate over a query. I know I can leverage the underlying Java to loop over each row, or just iterate over the record count, but that’s a bit rubbish and makes for unnecessarily verbose code.What would be better would be to have the for() loop construct emulate the the simplicity of <cfloop query="q">, which iterates over each row of the query, exposing column values as either #q.columnName# or just #columnName# (and also q.currentRow or just currentRow).for (query){ writeOutput("#currentRow#, #columName#<br />");}If a variable had to be created to contain the row ref, then we could have;for (rowRef in query){ writeOutput("#rowRef.currentRow#, #rowRef.columName#<br />"); // or something}I can’t see something like that being very hard to implement, and makes for more readable code (IMO).-- Adam
Method:
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041455
External Customer Info:
External Company:
External Customer Name: Adam Cameron
External Customer Email: 17EB1A7649DA54C7992015A9
External Test Config: 05/15/2010
Attachments:
Comments: