Thanks Tim, and Dave.

In my case, it looks like the best/quickest fix is to simply move my output
into the IF block.  and I figured I had a 50/50 chance of getting the array
notation right... I lost.. <grins>

Shawn Grover

-----Original Message-----
From: Timothy Heald [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 10:20 AM
To: CF-Talk
Subject: RE: Setting Current row for query object???


if you do this:
<CFLOOP query="myQuery">
        <CFIF myQuery.currentRow is 3>
                output my query stuff
        </CFIF>
</CFLOOP>

That should work for you.  Also in SQL Server you can use a cursor to what
you are talking about, but they are really dangerous and would cause a major
overhead increase. Also the array notation would be like myQuery.myVar[3].

Tim Heald
ACP/CCFD :)
Application Development
www.schoollink.net

> -----Original Message-----
> From: Shawn Grover [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 12:11 PM
> To: CF-Talk
> Subject: Setting Current row for query object???
>
>
> If I have a query object with 4 records, is there a way to set the pointer
> to the third row, and use values from that record?
>
> I've tried this:
>
> <cfloop query="MyQuery">
>       <cfif MyQuery.nRowNumber eq 3>
>               <cfbreak>
>       </cfif>
> </cfloop>
> <cfoutput>MyQuery.FieldName: #MyQuery.FieldName#</cfoutput>
>
> however, the output is for the first row.  putting alerts in the if block,
> and after the loop show that the record is being found, but then
> the pointer
> resets to the first row.
>
> I know I can move my output into the CFIF block, but was hoping to avoid
> that (lots of code to move around in multiple places - and
> toooooo many uses
> of the query objects to use the bracket notation i.e.
> MyQuery[3].FieldName.
> it would take hours to change them all even with search and replace).
>
> Can the native query variable CurrentRow be used to SET the current row?
> (instead of just reporting the current row).
>
> Thanks in advance.
>
> Shawn Grover
>
>
>

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to