On Error Resume Next

Discussion in 'ASP General' started by Jitu>>, Jul 14, 2003.

  1. Jitu>>

    Jitu>> Guest

    Hi All,
    I've a query on On Error Resume Next. I've explained what I understand for
    each case, I'm not sure that this is true.

    Case:
    1] Used in Function/Sub: will resume to the next statement in the
    function or sub; but will not affect the error out side of the functions
    2] Used at the top of the asp page: will affect all the page code and
    will not affect the function/sub in the page at all.
    3] Used in the page where ever required: ????

    Regards,

    JITENDRA DAVDA
     
    Jitu>>, Jul 14, 2003
    #1
    1. Advertising

  2. Jitu>>

    Ray at Guest

    See in-line tests:

    "Jitu>>" <> wrote in message
    news:u%23cX$...
    > Hi All,
    > I've a query on On Error Resume Next. I've explained what I understand for
    > each case, I'm not sure that this is true.
    >
    > Case:
    > 1] Used in Function/Sub: will resume to the next statement in the
    > function or sub; but will not affect the error out side of the functions


    Call Test()
    response.write 1/0
    Sub Test()
    On error resume next
    x = 1/0
    End Sub




    > 2] Used at the top of the asp page: will affect all the page code and
    > will not affect the function/sub in the page at all.


    On Error Resume Next

    Call Test()
    response.write 1/0

    Sub Test()
    x = 1/0
    End Sub


    > 3] Used in the page where ever required: ????


    Not sure what you mean by this, unless you're talking about using it on the
    fly. You can do that like this:

    a = 1
    b = 0
    On Error Resume Next
    Response.Write a/b
    On Error Goto 0
    Response.Write a/b

    ''An error will be raised on the second division by zero. On Error Resume 0
    turns off the Resume Next option

    Ray at home
     
    Ray at, Jul 14, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: QUERY: 'On Error Resume Next' scope rules

    Kevin Spencer, Jun 17, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    599
    Kevin Spencer
    Jun 17, 2006
  2. Deniz Bahar
    Replies:
    2
    Views:
    516
    Andrey Tarasevich
    Mar 9, 2005
  3. jason

    Avoid On Error Resume Next?

    jason, Aug 14, 2003, in forum: ASP General
    Replies:
    7
    Views:
    195
    Ray at
    Aug 14, 2003
  4. Laphan

    The truth re On Error Resume Next

    Laphan, Oct 26, 2005, in forum: ASP General
    Replies:
    3
    Views:
    133
    Bob Barrows [MVP]
    Oct 26, 2005
  5. jay
    Replies:
    1
    Views:
    137
    Austin Ziegler
    Feb 22, 2007
Loading...

Share This Page