Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<cfbreak> for a recursive function?

Status
Not open for further replies.

pitz77

Programmer
Apr 27, 2004
14
US
will <cfbreak> work when I want to do the equivalent of ASP's "Exit Function"?

 
i dont know ASP, but I would look at CFABORT too.


=========================================
I have not failed. I've just found 10,000 ways that won't work.
Thomas A. Edison
 
You'd really have to post the function code..

CFBREAK works for loops.. so maybe it'd work for you but maybe not..

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Um, ok. <cfabort> will actually abort processing any further code. That's not what I want it to do.

As for the function...

Code:
<cffunction name="foo">
  <return = "foofoo">
  <cfif A=B>
    <cfreturn return>
    break here and do not process any further code in THIS function.  Continue processing outside of the function.
  <cfelse>
    ...code
  </cfif>
  .... lots of other code
  <cfreturn return>
</cffunction>
 
cfreturn WILL return from the function and continue processing code thereafter, so you don't need anything after that tag. The docs do say, however, that you can only have one cfreturn tag per function.

-Tek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top