January 18, 2007

Can ColdFusion "continue"?

Believe it or not, ColdFusion does not support “continue” (nor tag: “cfcontinue”).

This script demonstrates one of possible ways how you can simulate “continue” behavior:

<cfloop from="1" to="10" index="i">
<cfthrow type="continue">
<cfcatch type="continue">
<!--- ignore --->


Since 5th October 2009, day when CF9 has been released, developer can, finally, cfcontinue ;) Hooray. Ah, yes, "lupus in fabula", Adobe introduce cffinally as well.


jones said...

Nice blog...
visit also coldfusion example

creole said...

Actually ColdFusion does support continue, starting with ColdFusion 9.

Jason Dean said...

Actually, ColdFusion has supported continue for a while, in cfscript. The tag was just added in CF9.

Here are the docs for CF7 that shows continue can be used in a loop in cfscript. I am not sure if it existed in 6 or before, I didn't feel like taking the time to look.