On Error Resume Next

J

Jitu>>

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
 
R

Ray at

See in-line tests:

Jitu>> said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top