« Holiday Fun From Macromedia | Main | What Are You Hoping For This Holiday Season? »

December 21, 2004

Who Would Use a CFCONTINUE Tag?

This isn't an official survey (or even unofficial one, for that matter), but I'm wondering how many people out there would use a CFCONTINUE tag if there were one available. Personally, I find the ability to continue (to jump to the next item in a loop) very useful, and occasionally my ColdFusion code suffers without it. 90% of the time I easily get by with CFIF tags inside loops, but when there is a great deal of processing going on, and a lot of decisions being made, I've found myself having to nest a lot of CFIF tags when a CFCONTINUE tag could have simplified my code. What are your thoughts?

Posted by cantrell at December 21, 2004 11:35 AM

Comments

I sent in a feature request to Macromedia or Allaire (can't remember who) several years back and never heard back from them. This seems like an easy one to me and I would use it all the time if I had it available.

Posted by: Steve at December 21, 2004 11:44 AM

I so wish there was a tag like this - especially if it came with a 'step through' interface button. I hate using cfabort or a whole bunch of IF's. If it were only like Director.

Posted by: ross at December 21, 2004 11:50 AM

That would be a useful feature. I guess this means we cant hope for it in blackstone :(

Posted by: Ryan Guill at December 21, 2004 11:59 AM

I'd also vote for this tag. I'm wondering why there is no such tag, but a "continue" command for cfscript. So i always try to use cfscript for this thing.

Posted by: Hendrik kramer at December 21, 2004 12:07 PM

Most modern programming languages have such a statement to bypass code. Having available in CF would be VERY useful.

Posted by: Steve Moore at December 21, 2004 12:36 PM

oh oh, oh oh

Raises hand a la Horshack

Posted by: Greg at December 21, 2004 1:02 PM

Oh yeah. I'd LOVE for there to be one, especially since there's already one for CFSCRIPT. It's not uncommon to write blocks of code in CFSCRIPT (that would be better of as tags) specifically for this functionality, since the CFTRY..CFTHROW..CFCATCH workaround far from elegant.

Posted by: Barneyb at December 21, 2004 1:29 PM

P U H L E E Z E !

Posted by: Paris Finley at December 21, 2004 1:32 PM

Lots of people have asked for this one, and it should indeed be added to the language (and no, it is not in Blackstone).

Having said that, in almost 10 years of CF coding, I honestly can't remember ever needing it.

Posted by: Ben Forta at December 21, 2004 2:31 PM

It's Christmas time!

For sure it's a desirable feature. And not a new request, take a look:

http://www.google.com/search?sourceid=navclient&hl=pt-BR&ie=UTF-8&oe=UTF-8&q=CFCONTINUE

Posted by: Alex Hubner at December 21, 2004 2:36 PM

I can't think of where I'd use it but having the option would prove useful to someone.

Posted by: Michael Dinowitz at December 21, 2004 2:37 PM

Count me in!

Posted by: Stacy Young at December 21, 2004 4:28 PM

Yeah, we need it, and we need it badly.

Posted by: Adedeji Olowe at December 21, 2004 9:22 PM

Yeah, we need it, and we need it badly.

Posted by: Adedeji Olowe at December 21, 2004 9:22 PM

I'm with Ben on this one. It sounds useful, and I see a lot of people who are interested... but I've never personally thought, "y'know, what I need is 'cfcontinue'."

Posted by: Roger Benningfield at December 21, 2004 9:27 PM

Nope.... never came up when I've been coding either.

Posted by: Tomas at December 22, 2004 10:06 AM

We need it!! It will save us couple of cfifs :)

Posted by: Angelos Constantinou at December 22, 2004 12:55 PM

I always need this tag! Would rock!

Posted by: Scott Mebberson at December 22, 2004 10:19 PM

Yep a CONTNUE tag and or a BREAK tag would be very welcome. CONTINUE runs the next LOOP without executing any further code in the current loop. BREAK kills the loop and jumps to the next executable statement. Its a standard part of most programming languages like VB, C, JAVA and so on. Though I must admit I don't actually miss it much as its easy enough to code using condition flags and I use such things fairly rarely anyway.

Posted by: Steve Powell at December 23, 2004 6:47 AM

Official of Unofficial, I vote "yes" for the cfcontinue tag.
When you have a very long block of code inside of a cfloop, there are times when you reach a condition and just want to jump to the next iteration of the loop (without having to have use an ungainly/unnecessary "if" solution). I currently use the cftry-cfthrow-cfcatch approach that Barney mentioned. I even considered creating a set of custom tags for this a while back. cf_loop and cf_continue.
So, yes please rattle whatever cubicle you need to to get this done. Because I love CF and I NEED cfcontinue.

Posted by: Chris Phillips at December 23, 2004 7:43 PM

Yes, much needed.

Posted by: Gobo at December 24, 2004 8:11 PM

cfbreak exists since atleast cf 4.0 (can't find my 3.1 or 2.0 docs, but you're probably not running those anyway). As for cfcontinue, it baffles me why there isn't one yet. Very typical loop control stuff. I'd use it repeatedly.

Posted by: Mike Vierow at January 26, 2005 7:51 PM

Three phrases should be among the most common in our daily usage. They are: Thank you, I am grateful and I appreciate.

Posted by: penis at December 10, 2005 2:49 AM




Remember Me?

(you may use HTML tags for style)