11-10-2009, 09:07 PM
I'm not sure of the technical difference, but I believe they are just a difference in languages. VBScript/ASP is an Error object. Other languages that are object oriented (.NET, C++, Java) (3GL) use an exception object for errors.
VBScript example
VB.NET example
C#
The exception is more powerful. It is also not dependent on the vague and often odd Microsoft Error codes to trigger a handle condition. For example, you can actually test for an exception of type System.IO.Exception instead of trying to case all the -214XXXXX error codes.
Hope this helps.
VBScript example
Code:
on error resume next
a = 1/0
if err.number <> 0 then
msgbox err.description
end if
VB.NET example
Code:
Try
a=1/0
Catch (ex as exception)
msgbox ex.message
End Try
C#
Code:
try
{
a=1/0
}
catch (exception ex)
{
msgbox ex.message
}
The exception is more powerful. It is also not dependent on the vague and often odd Microsoft Error codes to trigger a handle condition. For example, you can actually test for an exception of type System.IO.Exception instead of trying to case all the -214XXXXX error codes.
Hope this helps.