|
-
Jun 12th, 2000, 07:12 AM
#1
Thread Starter
Addicted Member
Every time there is an error, I like my program run another procedure and when it finish, go to the next line in the original procedure.
Do I use "On error Goto"? Please give me an example because I am stuck.
-
Jun 12th, 2000, 07:27 AM
#2
transcendental analytic
Yes here's the basic idea about error handling:
On error goto errorhandler:
a statement or method causing error
exit [methodtype] 'avoids errorhandler to execute after method contents
errorhandler:
handling the error
resume next 'Resumes to next line
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 12th, 2000, 07:29 AM
#3
PowerPoster
All you need is the Resume Next in you Error Handle routine to continue the next command line.
Code:
Private Sub Form_load()
On Error Goto MyErrorHandle
>>Your code here
Exit Sub
MyErrorHandle:
>>Do What ever you want here.
Resume Next
End Sub
-
Jun 12th, 2000, 07:37 AM
#4
Thread Starter
Addicted Member
-
Jun 12th, 2000, 07:51 AM
#5
Fanatic Member
Hello Shark!
You should take a look at these too.
- Resume
- Resume [0]
- Resume Next
- Resume line
Chemically Formulated As:
Dr. Nitro
-
Jun 12th, 2000, 09:42 AM
#6
Hmmm...sounds like you are expecting an error
Ok if you are expecting an error...you probably know the line of code that is going to generate it...(does happen and can be valid e.g testing for an Excel instance). Trap the error with something like
If Err = 427 Then Err = 0
Allows the program to continue execution without any GoTos.
Probably not what you are after but what the heck its FYI
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
|