I wouldn't use it in a UDF. I was replying to Rob's comment that CFEXIT is only relevent in custom tags, nothing to do with your original question. I think the correct behaviour of CFEXIT inside CFFUNCTION should be "syntax error", but that's just me.
I thought of a valid, non-development use of CFABORT inside a UDF. A relocate() function, which uses CFHEADER or getPageContext().forward() to jump to another resource, and calls CFABORT after the CFHEADER to terminate processing. I actually use exactly this all the time, but I'd forgotten, since I wrote it back when CFMX was brand new, and haven't touched it since. Cheers, barneyb > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Vince Bonfanti > Sent: Tuesday, June 29, 2004 3:13 PM > To: [EMAIL PROTECTED] > Subject: RE: [CFCDev] CFEXIT or CFABORT within CFFUNCTION > > So what's the "current template" when you're executing within a CFC > function? > > Actually, this is a trick question, since I know the answer. > On CFMX, doing > CFEXIT METHOD="exittemplate" within a CFC function has the > same effect as > CFRETURN without a return variable. That is, control goes back to the > caller. BlueDragon considers the caller to be the "current > template". A > BlueDragon customer brought this discrepancy to our > attention, which is why > I asked. > > I can see use of CFEXIT within a CFFUNCTION UDF, but would > still claim it > makes not sense within a CFC function. > > Vince > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Barney Boisvert > > Sent: Tuesday, June 29, 2004 6:01 PM > > To: [EMAIL PROTECTED] > > Subject: RE: [CFCDev] CFEXIT or CFABORT within CFFUNCTION > > > > You can use CFEXIT METHOD="exittemplate" anywhere to abort > > the current template, but not the request. I don't use it > > much, but it's occasionally useful where you'd otherwise have > > to put an entire file (generally a FB > > fuse) inside a conditional. I think it helps with > > readability to say "if this isn't true, don't execute the > > fuse" at the top of the file, rather than wrapping the entire > > content inside a CFIF block. This is a poor example, but > > when the "big nastiness" is more than 30-40 lines, and has a > > lot of nested conditionals or whatever, you start to see the > > benefit to readability. > > > > <cfif someTest> > > <!--- big nastiness ---> > > </cfif> > > > > Versus > > > > <cfif NOT someTest> > > <cfexit method="exittemplate" /> > > </cfif> > > > > <!--- big nastiness ---> > > > > Cheers, > > barneyb > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] > > > Sent: Tuesday, June 29, 2004 2:47 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [CFCDev] CFEXIT or CFABORT within CFFUNCTION > > > > > > > > > > > > > > > > > > Vince. As far as I know, CFEXIT only has application in > > custom tags. > > > As for CFABORT, my feelings are that it should be allowed > anywhere, > > > and when it's encountered, all processing should halt. We use it > > > almost exclusively for debugging. > > > > > > -Rob > > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at > www.mail-archive.com/[EMAIL PROTECTED] > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
