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