|
I’m not trying to slight your
approach in the least – it is indeed more compact and prettier to read.
I guess I’m just an efficiency buff – I’ve never been a fan
of wrapping things that are fairly simple to do and that already do what you’re
trying to do just for the sake of making it look prettier. And yes, if CF had
these functions natively, I would use them over the current methods for sure J Anyway, if you’re _really_ aiming to make this easier for
people, mightn’t this be better suited to a combination of a custom tag _and_ CFC? The CFC would do exactly what
you have planned. The custom tag would wrap the CFQUERY tag and return an
instance of your CFC. That would make things even easier since there’s
no CFC to create from the user’s perspective. It would provide a full
wrapper for cfqueries. <cfquery2 datasource=”mydsn”
name=”myquery”> SELECT something FROM
somewhere </cfquery2> <cfset lastRecord =
myquery.movelast()> Roland From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Farrar Roland Collins wrote: Want the last record? myquery.mycolumnname[myquery.recordcount] or... Want to start half way through the query? for (i = myquery.recordcount / 2; i lte
myquery.recordcount; i = i + 1) { somevalue =
myquery.mycolumnname[i]; } or... Want to abort arbitrarily? for (i = 0; i LTE myquery.recordcount; i =
i + 1) { somevalue =
myquery.mycolumnname[i];
if (somevalue is ‘my_matching_value’) break; } or... Or even better: while (myquery.mycolumname[i] is not
‘my_matching_value) {
doSomething();
i = i + 1; } while(objQuery.myColumnname is not
'my_matching_value') { I guess I understand wanting to have a familiar
way of iterating over data when you’re using multiple platforms, but I
really don’t know anything that the ADO/.NET model has that the CF model
doesn’t either! Roland The point is this. Yes if you know how you can do all
of these functions in CF. Yet in every last case of examples you showed (even
thought the last one required a couple of more typing characters... the CFC
method is easier to implement, easier to read... and just more pleasant
working. Isn't that why we use ColdFusion... because it makes programming more
pleasant? This is using the language to take it to the next level. |
- RE: [CFCDev] query object Murat Demirci
- RE: [CFCDev] query object Murat Demirci
- Re: [CFCDev] query object John Farrar
- RE: [CFCDev] query object Murat Demirci
- Re: [CFCDev] query object Peter J. Farrell
- RE: [CFCDev] query object Murat Demirci
- RE: [CFCDev] query object Roland Collins
- Re: [CFCDev] query object John Farrar
- RE: [CFCDev] query object Roland Collins
- Re: [CFCDev] query object John Farrar
- RE: [CFCDev] query object Roland Collins
- RE: [CFCDev] query object Murat Demirci
- Re: [CFCDev] query object John Farrar
- Re: [CFCDev] query object John Farrar
- Re: [CFCDev] query object CFC Beta John Farrar
- RE: [CFCDev] query object CFC Beta Roland Collins
- RE: [CFCDev] query object CFC Beta Adam Cameron
- Re: [CFCDev] query object CFC Beta John Farrar
- RE: [CFCDev] query object CFC Beta Ben Rogers
- RE: [CFCDev] query object CFC Beta Adam Cameron
- Re: [CFCDev] query object CFC Beta Joe Rinehart
