Hi All,

I am a newbie as far as VB scripting goes.

Would anybody be able to help me with error handling in vb script?

The following statement gives an error, though "ErrHandler:" tag exists in
the same routine
on error goto ErrHandler

kd

Re: On Error Goto ErrorHandler by Bob

Bob
Sat Mar 12 03:51:01 CST 2005

kd wrote:
> Hi All,
>
> I am a newbie as far as VB scripting goes.

Here's the documentation: http://tinyurl.com/7rk6
That always helps.

>
> Would anybody be able to help me with error handling in vb script?
>
> The following statement gives an error, though "ErrHandler:" tag
> exists in the same routine
> on error goto ErrHandler
>
> kd

Sorry, the only error-handling in vbscript is done by

on error resume next 'turn on error-trapping

'statements whose errors you wish to discard

on error goto 0 'turn off error-trapping

'statements whose errors you wish vbscript to handle

on error resume next

'statement whose error you wish to handle

if err <> 0 then
'handle the error
end if
on error goto 0

Sorry,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: On Error Goto ErrorHandler by Don

Don
Sat Mar 12 03:53:51 CST 2005

Can't goto a label in vbscript
You need to use On Error Resume Next and pick up the error number if <> 0




"kd" <kd@discussions.microsoft.com> wrote in message
news:E77EE3EF-AA2C-47FD-85D2-770BB1FF9A5A@microsoft.com...
> Hi All,
>
> I am a newbie as far as VB scripting goes.
>
> Would anybody be able to help me with error handling in vb script?
>
> The following statement gives an error, though "ErrHandler:" tag exists in
> the same routine
> on error goto ErrHandler
>
> kd
>



Re: On Error Goto ErrorHandler by kd

kd
Sat Mar 12 07:55:02 CST 2005

Thanks for the documentation link.
kd

"Bob Barrows [MVP]" wrote:

> kd wrote:
> > Hi All,
> >
> > I am a newbie as far as VB scripting goes.
>
> Here's the documentation: http://tinyurl.com/7rk6
> That always helps.
>
> >
> > Would anybody be able to help me with error handling in vb script?
> >
> > The following statement gives an error, though "ErrHandler:" tag
> > exists in the same routine
> > on error goto ErrHandler
> >
> > kd
>
> Sorry, the only error-handling in vbscript is done by
>
> on error resume next 'turn on error-trapping
>
> 'statements whose errors you wish to discard
>
> on error goto 0 'turn off error-trapping
>
> 'statements whose errors you wish vbscript to handle
>
> on error resume next
>
> 'statement whose error you wish to handle
>
> if err <> 0 then
> 'handle the error
> end if
> on error goto 0
>
> Sorry,
> Bob Barrows
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>