Reads certain value for a certain setting from FullJSONString text block.
See screenshot for what value will return.
This is one of multiple functions will be posted here next, each will read certain part of json.
Function SettingRead_JSON(SettingName, FullJSONString)
' Reads certain value for a certain setting from FullJSONString
' simply searching for that string enclosed with " and get what is after : until , or ] or ] or ) is found
' Needs VBINSTR, CutString9, strUnQuote
'
' "currency": "USD",
' "symbol": "APD",
' "exchangeName": "NYQ",
' "instrumentType": "EQUITY",
' "firstTradeDate": 322151400,
'
Rett = ""
Found1 = VBInstr(SettingName, FullJSONString) ' Find "Symbol"
If Found1 = 0 Then GoTo ByeBye
Found2 = VBInstr(":", FullJSONString, Found1) ' Find : after word "Symbol"
If Found2 = 0 Then GoTo ByeBye
sRettJ = CutString9(FullJSONString, ":", ",|}|]|)", , Found1)
If sRettJ < > FullJSONString Then Rett = Trim(strUnQuote(sRettJ))
ByeBye:
SettingRead_JSON = Rett
End Function
' Reads certain value for a certain setting from FullJSONString
' simply searching for that string enclosed with " and get what is after : until , or ] or ] or ) is found
' Needs VBINSTR, CutString9, strUnQuote
'
' "currency": "USD",
' "symbol": "APD",
' "exchangeName": "NYQ",
' "instrumentType": "EQUITY",
' "firstTradeDate": 322151400,
'
Rett = ""
Found1 = VBInstr(SettingName, FullJSONString) ' Find "Symbol"
If Found1 = 0 Then GoTo ByeBye
Found2 = VBInstr(":", FullJSONString, Found1) ' Find : after word "Symbol"
If Found2 = 0 Then GoTo ByeBye
sRettJ = CutString9(FullJSONString, ":", ",|}|]|)", , Found1)
If sRettJ < > FullJSONString Then Rett = Trim(strUnQuote(sRettJ))
ByeBye:
SettingRead_JSON = Rett
End Function
SettingName, FullJSONString
Views 244
Downloads 111
CodeID
DB ID
![](/Assets/UsersPics/userpic_3M62Ihum9O.jpg)
ANmarAmdeen
642
Revisions
v1.0
Monday
January
8
2024
![](/Assets/img/_load903.gif)