sktanmoy Active Member Licensed User Longtime User Jan 20, 2013 #1 Code B4X: Dim m1, m2 As Map Dim j As JSONParser j.Initialize(File.ReadString(File.DirAssets, "a.json")) m1 = j.NextObject Dim m As List m2 = m1.Get("articles") m = m2.Get("name") For Each m3 As String In m Log(m3) Next And JSON B4X: { "articles": [ { "name": "First Item", "article": "First Article" }, { "name": "Second Item", "article": "Second Article" } ] } How should I fix?
Code B4X: Dim m1, m2 As Map Dim j As JSONParser j.Initialize(File.ReadString(File.DirAssets, "a.json")) m1 = j.NextObject Dim m As List m2 = m1.Get("articles") m = m2.Get("name") For Each m3 As String In m Log(m3) Next And JSON B4X: { "articles": [ { "name": "First Item", "article": "First Article" }, { "name": "Second Item", "article": "Second Article" } ] } How should I fix?
Erel B4X founder Staff member Licensed User Longtime User Jan 20, 2013 #2 B4X: Dim m1 As Map = j.NextObject Dim L1 As List = m1.Get("articles") For Each m As Map in L1 Log("Name = " & m.Get("name")) Next Upvote 0
B4X: Dim m1 As Map = j.NextObject Dim L1 As List = m1.Get("articles") For Each m As Map in L1 Log("Name = " & m.Get("name")) Next