Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > On Error Resume Next

Reply
Thread Tools

On Error Resume Next

 
 
Jitu>>
Guest
Posts: n/a
 
      07-14-2003
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


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      07-14-2003
See in-line tests:

"Jitu>>" <(E-Mail Removed)> wrote in message
news:u%23cX$(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
handle ArgumentError to resume loop at next iteration jay Ruby 1 02-22-2007 05:18 PM
Re: QUERY: 'On Error Resume Next' scope rules Kevin Spencer ASP .Net 0 06-17-2006 03:33 PM
The truth re On Error Resume Next Laphan ASP General 3 10-26-2005 01:43 PM
CurrentElement->next = CurrentElement->next->next (UNDEFINED?) Deniz Bahar C Programming 2 03-09-2005 12:45 AM
Avoid On Error Resume Next? jason ASP General 7 08-14-2003 10:26 PM



Advertisments