- Linux MultiMedia Studio Computer Accessories User Manual

Mint v4 PC Programming Guide
30
MN1278 05.2001
Figure 3-13: Example Dialog Box
9. Add the following code to trap this (or any other error).
Private Sub Command1_Click()
Dim bState As Boolean
On Error GoTo command1_error
'*********************************************
' Read the state of the drive enable for axis 0
'*********************************************
myController.getDriveEnable -1, bState
'*********************************************
' Toggle the state of the enable
'*********************************************
myController.setDriveEnable 0, (bState = False)
Exit Sub
command1_error:
'*********************************************
' Display the error and leave subroutine
'*********************************************
MsgBox Error$
Exit Sub
End Sub