On 8/29/02, Angel Stewart penned: >I keep getting errors as though CF is totally ignoring the CFIF >statement and still parsing the </CFLOOP> tag. > >Here is some simple sample code: > ><CFIF LoopYes EQ True> > > <cfloop index="count" from="1" to="10"> > ></CFIF> > > <cfloop index="theindex" from="1" to="2"> > The index Is <CFOUTPUT>#theindex# </CFOUTPUT> > </cfloop> > ><CFIF LoopYes EQ True> > > </cfloop> ></cfif>
Yeah. This is no good: <CFIF LoopYes EQ True> <cfloop index="count" from="1" to="10"> </CFIF> Do this instead: <CFIF LoopYes EQ True> <cfset variables.loopto = 10> (or the number of loops you want) <CFELSE> <cfset variables.loopto = 1> </CFIF> <cfloop index="count" from="1" to="#variables.loopto#"> <cfloop index="theindex" from="1" to="2"> The index Is <CFOUTPUT>#theindex# </CFOUTPUT> </cfloop> </cfloop> You'll still get the loop, but only 1 loop which would really not be a loop. :) -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 ______________________________________________________________________ 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists