Originally posted by enigmatheatre
View Post
Dave
If this is your first visit, be sure to check out the FAQ. You must register before you can post.
IMPORTANT: Your first post will be checked for appropriate content. This may take a bit of time.
Function CallCAPI(ByVal intDevRef As Integer, ByVal strDevCmd As String) As CAPIControlResponse
hs.writelog("CallCAPI", "Device Reference: " & intDevRef & " strDevCmd: " & strDevCmd)
CallCAPI = CAPIControlResponse.Indeterminate
For Each objCAPIControl As CAPIControl In hs.CAPIGetControl(intDevRef)
If LCase(objCAPIControl.Label) = LCase(strDevCmd) Then
CallCAPI = hs.CAPIControlHandler(objCAPIControl)
Exit For
End If
Next
End Function
Sub Main(ByVal params As String)
Dim SplitParam() As String = Split(params, ",")
CallCAPI(SplitParam(0), SplitParam(1))
End Sub
Function CallCAPI(ByVal intDevRef As Integer, ByVal strDevCmd As String) As CAPIControlResponse
hs.WriteLog("CallCAPI", "Device Reference: " & intDevRef & " strDevCmd: " & strDevCmd)
CallCAPI = CAPIControlResponse.Indeterminate
For Each objCAPIControl As CAPIControl In hs.CAPIGetControl(intDevRef)
If LCase(objCAPIControl.Label) = LCase(strDevCmd) Then
CallCAPI = hs.CAPIControlHandler(objCAPIControl)
Exit For
End If
Next
End Function
Function CallCAPI(ByVal intDevRef As Integer, ByVal strDevCmd As String) As CAPIControlResponse
hs.WriteLog("CallCAPI", "Device Reference: " & intDevRef & " strDevCmd: " & strDevCmd)
CallCAPI = CAPIControlResponse.Indeterminate
For Each objCAPIControl As CAPIControl In hs.CAPIGetControl(intDevRef)
If LCase(objCAPIControl.Label) = LCase(strDevCmd) Then
CallCAPI = hs.CAPIControlHandler(objCAPIControl)
Exit For
End If
Next
End Function
Comment