VB code snippet for using the statusResponseManager


Private Sub StatusResponseExampleBtn_Click()

On Error GoTo Err_Trap

'### StatusResponseManager Interface
Dim statusResponseManagerEx As STATUSRESPONSEMANAGER430Lib.StatusResponseManager
Set statusResponseManagerEx = New StatusResponseManager

'### StatusResponse Interface
Dim statusResponseEx As StatusResponse
Dim bStatus As Boolean

Dim strOutput As String
strOutput = ""

'### Open the response xml File
bStatus = statusResponseManagerEx.LoadXML("response01.xml", statusResponseEx)
If (bStatus) Then
    Dim pObjectType As STATUSRESPONSEMANAGER430Lib.ObjectType
    Dim pStatusType As STATUSRESPONSEMANAGER430Lib.StatusType
    Dim lTimestamp As Long
    Dim dRequestDate As Date
    Dim strRequestID As String
    
    '### Get the first entry
    bStatus = statusResponseEx.GetFirstQueryObject(pObjectType, strRequestID, dRequestDate,  _
                                                   lTimestamp, pStatusType)
    If (bStatus) Then
         strOutput = strOutput + strRequestID + " " + Str(lTimestamp) + " " +  _
                     Format(dRequestDate, "YYYY-MM-DDTHH:MM:SS") + vbCrLf
        '### Loop through all remaining entries
        Do While statusResponseEx.GetNextQueryObject(pObjectType, strRequestID, dRequestDate,  _
                                                     lTimestamp, pStatusType)
            strOutput = strOutput + strRequestID + " " + Str(lTimestamp) + " " +  _
                        Format(dRequestDate, "YYYY-MM-DDTHH:MM:SS") + vbCrLf
        Loop
    Else
        strOutput = "No results have been found"
    End If
Else
    strOutput = "Failed to open document"
End If
    
MsgBox (strOutput)

'### relase resources
Set statusResponseEx = Nothing
Set statusResponseManagerEx = Nothing

Exit Sub

Err_Trap:
    MsgBox "Error: " & Err.Description, vbCritical, _
           "Opps! Error" & Str$(Err.Number)
'### relase resources
Set statusResponseEx = Nothing
Set statusResponseManagerEx = Nothing


End Sub