|
-
Nov 15th, 2001, 02:38 PM
#1
Thread Starter
New Member
Error Handling
OK, this is real simple, but for some reason it's not working for me.
I just started playing around with VB6, and decided it was time to put some error checking in the code but.....
I can't seem to raise the error "flag" so that I can trap an error.
I even went so far as to create a new project with only a couple of lines in the Form-Load page.
ie
on error goto err_chk:
err.raise 71
err_chk:
msgbox.....
this doesn't work, I get the default error msg.
I've stepped through, and sure enough, it's blowing up
at the "err.raise" line.
Is there something that I'm missing ????
Thanx in advance
GDR01
-
Nov 15th, 2001, 02:49 PM
#2
Err.Raise is something that is used, typically, when creating an ActiveX object, or a component. Standard error trapping is the conventional method for handling errors in Standard VB projects.
-
Nov 16th, 2001, 05:23 AM
#3
To force an error you should use the ERROR function, eg: " ERROR 23 " would cause error 23 to occur.
err.raise forces the error to be sent to the calling sub/function etc, so should only be used when you don't want to handle the error within that sub.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|