Sub Process_Globals
Type SCItem (Supplier As String, Clr As String)
End Sub
Sub AppStart (Args() As String)
Dim s As String = $"[{"Supplier": "COCA COLA", "Color": "BLACK"},
{"Supplier": "COCA COLA", "Color": "BLACK"},
{"Supplier": "COCA COLA", "Color": "BLACK"},
{"Supplier": "COCA COLA", "Color": "BLACK"},
{"Supplier": "COCA COLA", "Color": "YELLOW"},
{"Supplier": "NIKE", "Color": "ZERO"},
{"Supplier": "JORDANS", "Color": "RED"},
{"Supplier": "JORDANS", "Color": "RED"},
{"Supplier": "PEPSI", "Color": "NORMAL"},
{"Supplier": "PEPSI", "Color": "LITE"},
{"Supplier": "PEPSI", "Color": "LITE"},
{"Supplier": "PEPSI", "Color": "LITE"}
]"$
Dim items As Map
items.Initialize
Dim parser As JSONParser
parser.Initialize(s)
For Each m As Map In parser.NextArray
Dim item As SCItem = CreateSCItem(m.Get("Supplier"), m.Get("Color"))
items.Put(SCItemToKey(item), item)
Next
For Each item As SCItem In items.Values
Log(item)
Next
End Sub
Private Sub SCItemToKey (item As SCItem) As String
Return item.Supplier & ":" & item.Clr
End Sub
Public Sub CreateSCItem (Supplier As String, Clr As String) As SCItem
Dim t1 As SCItem
t1.Initialize
t1.Supplier = Supplier
t1.Clr = Clr
Return t1
End Sub