SHARE
TWEET

Untitled

a guest Mar 16th, 2017 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub ParseJSONBackupIRCodes(json As String) As String
  2.     Dim data As String = ParseJSONBackupData(json)
  3.  
  4.     Dim parser As JSONParser
  5.     parser.Initialize(data)
  6.    
  7.     Dim root As Map = parser.NextObject
  8.     Dim irList As List = root.Get("irList")
  9.    
  10.     Dim deviceMap As Map
  11.     deviceMap.Initialize
  12.    
  13.     Dim deviceMap2 As Map
  14.     deviceMap2.Initialize
  15.    
  16.     Dim deviceList As List = root.Get("deviceList")
  17.     For Each coldeviceList As Map In deviceList
  18.         Dim deviceNo As Int = coldeviceList.Get("deviceNo")
  19.         Dim deviceName As String = coldeviceList.Get("deviceName")
  20.         Dim deviceType As Int = coldeviceList.Get("deviceType")
  21.            
  22.         deviceMap.Put(deviceNo,deviceName)
  23.         deviceMap2.Put(deviceNo,deviceType)    
  24.     Next
  25.    
  26.     Dim output As String
  27.    
  28.     For Each colirList As Map In irList
  29.         Dim ir As String = colirList.Get("ir")
  30.         Dim deviceNo As Int = colirList.Get("deviceNo")
  31.         Dim order As String = colirList.Get("order")
  32.  
  33.         output = output & deviceMap.Get(deviceNo) & "," & Strings.order.Get(order) & "," & ir & CRLF
  34.     Next
  35.    
  36.     Return output
  37. End Sub
RAW Paste Data
Top