> but note you say you don't expect the same functionality... then you say "It doesn't work as expected". The expectation is to run like ASP, that is where it came from. (Or VBScript)
 
You're right at the end they are similar.
 
> If I get a window and someone else doesn't do it first...
 
That's not my principle John since there are lots of works to do, I have to sort them.
 
> Write up all the specs for me... and I will put one together. The advantage to doing it in a CFC is you can pass the recordset in... CF can dynamically move to any record, forward, back... etc. A custom tag would not do this for you... tags can't be instantiated and lack persistance. UDF's also lack persistance. Therefore a CFC seems the way to go... unless someone has a reason to use another tool. (And please don't say CF5!)
 
I don't believe a CFC can solve the issues, but I'm sending the ready-to-use QueryIterator CFC here. The usage of this CFC is, you can enhance it:
 
<cfquery name="myQuery" datasource="myDsn">
select description from aTable
</cfquery>
<cfset qi = createObject("component", "QueryIterator").init(myQuery) />
<cfset i = 0 />
<cfloop condition="qi.hasNext()">
 <cfset qi.next() />
 <cfset i = i + 1 />
 <cfoutput>#i#. #qi.current("description")#<br /></cfoutput>
</cfloop>
 
Murat.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Farrar
Sent: Wednesday, February 23, 2005 7:17 PM
To: [email protected]
Subject: Re: [CFCDev] query object

John Farrar

I might like the functionality also... but note you say you don't expect the same functionality... then you say "It doesn't work as expected". The expectation is to run like ASP, that is where it came from. (Or VBScript) With that said... this is a cool concept... and I like your expectation. If I get a window and someone else doesn't do it first... I will try to package the concept up into a CFC to use.

My Concept...
objQuery
att: each field in query
att: recordCount
att: currentRow
method: next, previous... etc.

Write up all the specs for me... and I will put one together. The advantage to doing it in a CFC is you can pass the recordset in... CF can dynamically move to any record, forward, back... etc. A custom tag would not do this for you... tags can't be instantiated and lack persistance. UDF's also lack persistance. Therefore a CFC seems the way to go... unless someone has a reason to use another tool. (And please don't say CF5!)

John Farrar

Attachment: QueryIterator.cfc
Description: Binary data

Reply via email to