Ah, of course.  I somehow missed the point in the midst of the example code.
My bad.


----- Original Message -----
From: "Dan G. Switzer, II" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, August 27, 2002 9:19 AM
Subject: RE: CFMX & CurrentRow?


> Patti,
>
> My point was the same as Sean's and that the "currentRow" is only
> available while iterating over some type of CF query object (via
> cfoutput or cfloop.) You can't expect "currentRow" to equal the last row
> accessed after looping through a collection, unless you're actually
> declaring a variable called "currentRow" in the variables scope.
>
> -Dan
>
> > -----Original Message-----
> > From: Patti G. L. Hall [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 27, 2002 8:08 AM
> > To: CF-Talk
> > Subject: Re: CFMX & CurrentRow?
> >
> > None of your examples used the syntax:
> >
> > <cfoutput query="getEmloyee">
> > #currentrow#
> > </cfoutput>
> >
> > That one does work, which is I believe what Sean and Watts were
> saying.
> > CFLOOP is a completely different animal.
> >
> >
> > ----- Original Message -----
> > From: "Dan G. Switzer, II" <[EMAIL PROTECTED]>
> > To: "CF-Talk" <[EMAIL PROTECTED]>
> > Sent: Thursday, August 22, 2002 12:15 PM
> > Subject: RE: CFMX & CurrentRow?
> >
> >
> > > Sean,
> > >
> > > My reply was orientated more at the original post. The reason I post
> the
> > > question is I was wondering if maybe an unscoped "currentRow"
> variable
> > > was available to pre-CFMX versions that contained the last value of
> > > currentRow in a loop.
> > >
> > > However, I just tested this in CF4.51, CF5 and CFMX and an unscoped
> > > "currentRow" variable does not exist. For that matter, the all the
> > > different behaviors I tested acted the same:
> > >
> > > <!-- example 1 -->
> > > <cfquery name="getEmployee" datasource="cfsnippets">
> > > SELECT *
> > > FROM Employees
> > > </cfquery>
> > >
> > > <cfloop query="getEmployee">
> > > <cfset currentRow = getEmployee.currentRow>
> > > </cfloop>
> > >
> > > <cfoutput>#currentRow# :: #getEmployee.currentRow#</cfoutput>
> > >
> > >
> > > <!-- example 2 -->
> > > <cfquery name="getEmployee" datasource="cfsnippets">
> > > SELECT *
> > > FROM Employees
> > > </cfquery>
> > >
> > > <cfloop query="getEmployee">
> > > <cfset iTmp = currentRow>
> > > </cfloop>
> > >
> > > <cfoutput>#iTmp# :: #getEmployee.currentRow#</cfoutput>
> > >
> > >
> > > <!-- example 3 (causes an error) -->
> > > <cfquery name="getEmployee" datasource="cfsnippets">
> > > SELECT *
> > > FROM Employees
> > > </cfquery>
> > >
> > > <cfloop query="getEmployee">
> > > <cfset iTmp = currentRow>
> > > </cfloop>
> > >
> > > <cfoutput>#iTmp# :: #currentRow#</cfoutput>
> > >
> > > In all cases the first variable contained the total number of
> records
> > > and the second value either was undefined or "1".
> > >
> > > -Dan
> > >
> > > > -----Original Message-----
> > > > From: Sean A Corfield [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, August 22, 2002 10:53 AM
> > > > To: CF-Talk
> > > > Subject: Re: CFMX & CurrentRow?
> > > >
> > > > On Thursday, August 22, 2002, at 07:27 , Dan G. Switzer, II wrote:
> > > > > Out of curiosity, which syntax are you using:
> > > > >
> > > > > #currentRow#
> > > > >
> > > > > or
> > > > >
> > > > > #queryName.currentRow#
> > > > >
> > > > > I know that "#queryName.currentRow#" works.
> > > >
> > > > The latter. I wouldn't have expected the former to work - does it
> work
> > > in
> > > > pre-MX releases? The reason I think like that is that, to me,
> > > currentRow
> > > > is a pseudo-column so you shouldn't expect it to be available
> > > 'unadorned',
> > > > only as part of a query-qualified reference.
> > > >
> > > > "If you're not annoying somebody, you're not really alive."
> > > > -- Margaret Atwood
> > > >
> > > >
> > >
> >
> 
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to