troubleshooting Question

error handling

Avatar of v_iyengar
v_iyengar asked on
Visual Basic Classic
8 Comments1 Solution220 ViewsLast Modified:
Private Sub Command1_Click()


f

End Sub

Public Sub f()


Dim a, b, c, i
For i = 1 To 5
On Error GoTo errh
a = 0
b = 5
c = b / a

errh:
MsgBox Err.Description

Next i
End Sub

This is simulation on my code.
The error is caught first time ,the next time when the error occurs Run time error occurs.
I want the error to be caught again by error handler
how to do that?

I have done the same in c++ ,it works fine all the time it is caught by the error handler

main()
{
     int a,b,c;
     a=5;
     b=0;
     int i=0;
     for (i=0;i<5;i++)
     {
          try
          {
               c=a/b;
          }
          catch(...)
          {
          }
     }
}
ASKER CERTIFIED SOLUTION
rspahitz

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros