chapter31

development in a land far far away…

at the moment

History is not what happened. History is what was written down.

There are a couple of nice statements you can use to control processing within loops, namely

  • break
  • continue

Break is of course used to exit the current loop entirely and resume page processing from the first CF statement after the end loop tag. Lovely!

Continue has a subtle but handy difference, it ends the current loop iteration and ‘continues’ from the beginning of the next loop iteration. Very lovely :)

Now the problem is that there is no ColdFusion tag equivalent for continue, it’s only accessible when in a <cfscript> block. As far as I know this is the only statement in the CFML language which is available in <cfscript> but not tags :(

For some scenarios this will be ok, especially for the cfscripters out there. But for people who don’t like (for several reasons) <cfscript> then this is a limitation which I hope Adobe will address (among others!) in Scorpio.

And don’t forget that the inherent limitations of <cfscript> (limited cftag support) means that sometimes you won’t be able to do your logic in cfscript. For example you may want to use a <cfsavecontent> etc which you can’t do in <cfscript>.

I know…I know that you can create your own functions simulating tag functionality in cfscript but all gets a little messy doesn’t it?


Related Pages

  • No related posts

3 Responses to “Will CFMX8 have cfcontinue?”

  1. cfcontinue has not been implemented in the current release of Scorpio. I just added a request for enhancement (#65487) for it.

    Cheers.

    Rob Gonda

  2. I find the solution that is in the first comment of this page: http://weblogs.macromedia.com/cantrell/archives/2003/08/living_without.cfm
    a useful workaround in the meantime, but it is far from elegant.

    Ryan Guill

  3. Ah yes Ryan that would work splendidly! Nice one!






    This number will never be 5: #i#


    sharmo

Leave a Reply