|
-
October 15th, 1999, 07:58 AM
#1
Handling Run Time Errors
How do you handle run time errors ?
The code I have included works if 'MSComm1.CommPort = 1'.
When 'MSComm1.CommPort = 2' it throws up a run time error on certain machines where com port 2 is not available.
How can I handle this error so that I give an error message say port not available and the program can carry on ?
private Sub OptStart_Click()
pac = 0
state = 0
execute = 0
Timer1.Enabled = true 'START TIMER
MSComm1.PortOpen = true 'OPEN COMM PORT
static_send_packet 'SEND PACKET
End Sub
-
October 15th, 1999, 08:23 AM
#2
Re: Handling Run Time Errors
Check the helpfile for "on error", it will explain it pretty well what you can do to catch errors (on error resume next, or on error goto <label>...)
Crazy D @ Work :-)
-
October 15th, 1999, 08:58 AM
#3
Re: Handling Run Time Errors
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
|