Results 1 to 2 of 2

Thread: This may be a stupid question (error handling)

  1. #1

    Thread Starter
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Can't you make a general error handling procedure?
    Like if you put it in Form_Load that it will work for all Subs and Functions?
    I know you can make a sub for your error handling.. but you can't exit the current function from there right?

    Can't you make like the option explicit that it will work in all the subs?
    it makes me kinda crazy () copying and pasting the errorhandling code in all subs.

    Code:
    option on Error Goto handleit
    
    Private function handleit()
    Restore all
    Show MsgBox with error
    Exit Current Sub
    End Sub
    Isn't that possible?
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    You might be able to do something with events, but i'm not sure. This is something that frustrates all VB developers, but global error handling is supposed to be being tackled in VB7 with a global error object of some sort, along with try and catch functionality.
    Not much help right now I know...
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

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