
40
Sample program
'Display message depending upon content of response
'At error message : False
Private Functin ErrorHandler(ByVal sResponse As String) As Boolean
Dim nError As EER8527_ID
'Error response
If sResponse Like "ERROR=*" Then
If sResponse <> "ERROR=0" Then 'Error
nError = CLng(Right(sResponse, 1))
Select Case nError
Case eNo_Error
'0
'ShowLog "ERROR", "No Error."
Case esyntax_Error
'1
Showlog "ERROR", "Syntax error"
Case eOut_Of_Range
'2
ShowLog "ERROR", "Out of range."
Case eCondition
'3
ShowLog "ERROR", "Condition error of the parameter."
Case eInitializing
'4
ShowLog "ERROR", "Being initialized."
Case eTesting
'5
ShowLog "ERROR", "Testing."
Case eRemote_Off
'6
ShowLog "ERROR", "Remote Off."
Case eSet_Construction
'7
ShowLog "ERROR", "Construction error of an order for a SET or MEM."
Case eKey_Operating
'8
ShowLog "ERROR", "Being set up by the key operation."
Case Else
ShowLog "ERROR", "Undefined Error"
End Select
GoTo Err_ErrorHandler:
End If
End if
Exit_ErrorHandler:
ErrorHandler = True
Exit Function
Err_ErrorHandler:
ErrorHandler = False
Exit Function
End Function
'sec weight procedure
Private Sub sWait(ByVal sngSec As Single)
Dim lngStart As Long, lngEnd As Long
If sngSec = 0 Then Exit Sub
lngStart = GetTickCount()
lngEnd = ln (sngSec * 1000)
Do While GetTickCount() < lngEnd
DoEvents
Loop
End Sub