' This executes when the application first starts up.
' It fetches current list of stores from ASP-based Store Robot.
Private Sub GetStores()
  Dim strURL As String, Count As Integer

  ' Fetch WDDX Packet of data from Store Robot
  MyXML = Inet1.OpenURL("http://127.0.0.1/Robots/StoreRobot.asp")

  ' Deserialize the packet into a recordset
  Set StoresRS = MyDeser.deserialize(MyXML)

  ' Clear the current entries from ListBox
  cboStores.Clear

  ' Loop through the rows of the recordset
  ' For each row, add an item to the ListBox
  For Count = 1 To StoresRS.getRowCount
    cboStores.AddItem (StoresRS.getField(Count, "NAME"))
  Next Count

  ' Select the first item in the ListBox
  cboStores.ListIndex = 0

End Sub


' This executes when the user chooses a new store location.
Private Sub cboStores_Click()
  RowNum = cboStores.ListIndex + 1
  RobotServer = StoresRS.getField(RowNum, "HOST")
End Sub
