Hello,
I am using Erel's online json tool to get the json code easily . my received json is stg like this :
this goes long for many other symbols like BTC_BCN , BTC_BELA etc ...
The json tool gives me the following code :
problem for me here is I don't want to use dim BTC_BCN as map ..... because ther eare more than 2000 symbols like this and if i use this ode there will be many many lines. Is there a way to get those symbol names only with a different code. I only want to get the symbols like BTC_BCN , BTC_BELA etc...
if i log the root it gives
.... goes like this . I couldnt find a way to get the symbol only. Can you help it out. It must be easy but i cant get it.
I am using Erel's online json tool to get the json code easily . my received json is stg like this :
B4X:
{"BTC_BCN":{"id":7,"last":"0.00000026","lowestAsk":"0.00000027","highestBid":"0.00000026","percentChange":"0.08333333","baseVolume":"43.73921153","quoteVolume":"172390206.07905212","isFrozen":"0","high24hr":"0.00000027","low24hr":"0.00000024"},"BTC_BELA":{"id":8,"last":"0.00001774","lowestAsk":"0.00001774","highestBid":"0.00001772","percentChange":"-0.02954048","baseVolume":"4.12240710","quoteVolume":"220808.00322701","isFrozen":"0","high24hr":"0.00001933","low24hr":"0.00001732"}}
this goes long for many other symbols like BTC_BCN , BTC_BELA etc ...
The json tool gives me the following code :
B4X:
Dim parser As JSONParser
parser.Initialize(<text>)
Dim root As Map = parser.NextObject
Dim BTC_BCN As Map = root.Get("BTC_BCN")
Dim percentChange As String = BTC_BCN.Get("percentChange")
Dim high24hr As String = BTC_BCN.Get("high24hr")
Dim last As String = BTC_BCN.Get("last")
Dim highestBid As String = BTC_BCN.Get("highestBid")
Dim id As Int = BTC_BCN.Get("id")
Dim quoteVolume As String = BTC_BCN.Get("quoteVolume")
Dim baseVolume As String = BTC_BCN.Get("baseVolume")
Dim isFrozen As String = BTC_BCN.Get("isFrozen")
Dim lowestAsk As String = BTC_BCN.Get("lowestAsk")
Dim low24hr As String = BTC_BCN.Get("low24hr")
Dim BTC_BELA As Map = root.Get("BTC_BELA")
Dim percentChange As String = BTC_BELA.Get("percentChange")
Dim high24hr As String = BTC_BELA.Get("high24hr")
Dim last As String = BTC_BELA.Get("last")
Dim highestBid As String = BTC_BELA.Get("highestBid")
Dim id As Int = BTC_BELA.Get("id")
Dim quoteVolume As String = BTC_BELA.Get("quoteVolume")
Dim baseVolume As String = BTC_BELA.Get("baseVolume")
Dim isFrozen As String = BTC_BELA.Get("isFrozen")
Dim lowestAsk As String = BTC_BELA.Get("lowestAsk")
Dim low24hr As String = BTC_BELA.Get("low24hr")
problem for me here is I don't want to use dim BTC_BCN as map ..... because ther eare more than 2000 symbols like this and if i use this ode there will be many many lines. Is there a way to get those symbol names only with a different code. I only want to get the symbols like BTC_BCN , BTC_BELA etc...
if i log the root it gives
B4X:
(MyMap) {BTC_FLDC={highestBid=0.00000156, id=31, low24hr=0.00000152, last=0.00000157, high24hr=0.00000162, percentChange=-0.00632911, isFrozen=0, lowestAsk=0.00000157, quoteVolume=4880668.59574651, baseVolume=7.60407161},
.... goes like this . I couldnt find a way to get the symbol only. Can you help it out. It must be easy but i cant get it.