Results 1 to 5 of 5

Thread: Error Handling...

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    4

    Error Handling...

    What is the best and most efficient way of location exactly WHICH line causes an error? i use the on error statement most, but i have to put one on Every line until i can narrow down the error cause, is there one line/function that can do all that?

  2. #2
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Info.

    When you get an error, click the debug button which appears, and the VB IDE should go directly to the line which caused the error. The line will be highlighted yellow if you use the default IDE settings...

    You can also set Breakpoints in your code to aid in debugging...

    Hope this helps.
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Posts
    4

    I'm using error handlers

    Unfortunately my prog has a load of error handlers in it right now, a bunch of On error resume next... when i think there is an error occuring, intercede a:

    on error goto newError1

    newError1:
    msgbox err.number & ": " & err.description
    resume next

    but unfortunately, when i break i go to the msgbox line, not the line that caused the error... how do i get it to go to the error'd line?

  4. #4
    Megatron
    Guest
    One way is to remove the error handlers, and follow Digital Extreme's instructions. Once you get the line number, then you can put your error handlers back in.

  5. #5
    Hyperactive Member tumblingdown's Avatar
    Join Date
    Mar 2000
    Posts
    362
    It may not help, but remember Erl.



    td
    "One logical slip and an entire scientific edifice comes tumbling down." - Robert M. Pirsig


    [email protected]

    "but if Einstein is right and God is in the details, reality requires that we sometimes get religion." - Scott Meyers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width