October 15th, 1999, 07:58 AM
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
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