on error goto 0 in VBScript 
Author Message
 on error goto 0 in VBScript

Is on error goto 0 a legal VBScript statement to reset so-called error
handling to it's default state? We all know on error resume next, and it's
documented and everything. But I can't find on error goto 0 documented
anywhere. This does seem to work in an ASP though, for example:

    ' some code with default error handling enabled
    on error resume next
    objCon = Server.CreateObject("ADODB.Connection")
    SubroutineToCheckAdoStatus(objCon) ' It doesn't return if there is an
error
    on error goto 0
    ' some more code with default error handling enabled

Is the on error goto 0 documented anywhere? I use it on my Webs, but I don't
really like using something that isn't undocumented (like it could be pulled
in a subsequent release of VBScript because "it wasn't supposed to be there
to begin with" or something).

Thanks!

--
-glenn-



Thu, 09 May 2002 03:00:00 GMT  
 on error goto 0 in VBScript
That works and it should be documented.  It's kind of weird, I know, but
this is how you turn off "On Error Resume Next" in VB, so it's how you do it
in VBScript too.

Eric


Quote:
> Is on error goto 0 a legal VBScript statement to reset so-called error
> handling to it's default state? We all know on error resume next, and it's
> documented and everything. But I can't find on error goto 0 documented
> anywhere. This does seem to work in an ASP though, for example:

>     ' some code with default error handling enabled
>     on error resume next
>     objCon = Server.CreateObject("ADODB.Connection")
>     SubroutineToCheckAdoStatus(objCon) ' It doesn't return if there is an
> error
>     on error goto 0
>     ' some more code with default error handling enabled

> Is the on error goto 0 documented anywhere? I use it on my Webs, but I
don't
> really like using something that isn't undocumented (like it could be
pulled
> in a subsequent release of VBScript because "it wasn't supposed to be
there
> to begin with" or something).

> Thanks!

> --
> -glenn-



Fri, 10 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VBScript/ASP - Help with On Error Goto

2. Compilation error: On Error Goto...Syntax

3. On error Goto causes error in compilation

4. Error with On Error GoTo statement

5. Error with On error Goto... Vb4 32bits

6. Error with On Error GoTo statement

7. Error when using on error goto

8. On error goto not being called when getting an error

9. On Error GoTo?

10. On Error Goto

11. On Error Goto Label

12. On Error GoTo 0 ???

 

 
Powered by phpBB® Forum Software