>
> On Error Resume Next
>
> What is the replacement statement in Coldfusion
>
> <cftry>
> ---------------------------
> <cfcatch type="exception">
>
> </cfcatch>
>
> </cftry>
>
> I mean i have to cut/paste codes in both blocks, cftry and cfcatch?
> So, if error comes it will still run the codes in cfcatch block.
>
> What is the right way to do that?
There is no exact equivalent to "On Error Resume Next" in CFML. I would
argue that this is a good thing - I think that "On Error Resume Next" is
terrible!
Instead, we have exception handling. For any block of code that you expect
might fail, you can use CFTRY/CFCATCH to build an exception handler. In
addition to being able to continue running code, you can actually respond to
the specific problem encountered.
In your case, if you simply want to continue running code, you could do
this:
<cftry>
... problematic code goes here ...
<cfcatch type="any">
<!--- do nothing --->
</cfcatch>
</cftry>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

