> 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).

No, I think that your only options are to use array notation, which would
look like "myquery.fieldname[3]", not "myquery[3].fieldname", or to copy the
values from the third record into local variables within your loop.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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