cfscript's cfabort

2010-01-29 Thread Chad Gray

I have some CFScript running and each time I set a variable I run a function to 
check if there is an error.
 
If there is an error I would like to “CFAbort” the scripting so it does not 
continue.  Can you abort the rest of the script if the error function is 
called?  I tried break; in the function, but that does not seem to work.
 
Kinda like this:
 
cfscript
TK = createObject(COM,APToolkit.Object,expandPath('APToolkitNET.dll'));
varReturn = TK.stitchPDF(expandPath(pdf),1,0,0,546,546,0);
if (varReturn  1) {
error(stichPDF);
}
TK.CloseOutputFile();
ReleaseComObject(TK);
 
function error(method) {
errMsg = #method#  failed with a   #varReturn#;
ReleaseComObject(TK);
??CFAbort??
}
/cfscript
 
cfoutput#errMsg#/cfoutpu

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330257
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfscript's cfabort

2010-01-29 Thread Raymond Camden

CF9? If so, use abort;


On Fri, Jan 29, 2010 at 9:07 AM, Chad Gray cg...@careyweb.com wrote:

 I have some CFScript running and each time I set a variable I run a function 
 to check if there is an error.

 If there is an error I would like to “CFAbort” the scripting so it does not 
 continue.  Can you abort the rest of the script if the error function is 
 called?  I tried break; in the function, but that does not seem to work.

 Kinda like this

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330258
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: cfscript's cfabort

2010-01-29 Thread Chad Gray

Nope CF8.  I will put this on the list of reasons to upgrade though.


-Original Message-
From: Raymond Camden [mailto:rcam...@gmail.com] 
Sent: Friday, January 29, 2010 10:30 AM
To: cf-talk
Subject: Re: cfscript's cfabort


CF9? If so, use abort;





~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330260
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: cfscript's cfabort

2010-01-29 Thread Leigh

 Nope CF8.  I will put this on the list of reasons to
 upgrade though.

You could wrap the the cfabort in a cffunction. Then call it from cfscript. I 
believe there is a udf at cflib.org that does that..


 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330261
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: cfscript's cfabort

2010-01-29 Thread Chad Gray

Interesting idea... I could just take my function and put the entire thing in 
it.  Then call it.

I will try it out.
Thanks
Chad

-Original Message-
From: Leigh [mailto:cfsearch...@yahoo.com] 
Sent: Friday, January 29, 2010 10:44 AM
To: cf-talk
Subject: RE: cfscript's cfabort


 Nope CF8.  I will put this on the list of reasons to
 upgrade though.

You could wrap the the cfabort in a cffunction. Then call it from cfscript. I 
believe there is a udf at cflib.org that does that..


 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:330262
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4