Imagine, I have an array:
"result": {
"orders": Array[54][
{
"limit_speed": "0.02",
"alive": true,
"price": "0.0152",
"id": 1762041,
"type": 0,
"workers": 13,
"algo": 21,
"accepted_speed": "17.99093735"
},
{
"limit_speed": "0.02",
"alive": true,
"price": "0.0151",
"id": 1757084,
"type": 0,
"workers": 9,
"algo": 21,
"accepted_speed": "18.87724492"
......................................
......................................
......................................
Array truncated
Can I take a number of array elements (54) with JSONParse and assign it to a variable?
Array length (size) with JSONParse
Moderators: Dorian (MJT support), JRL
Re: Array length (size) with JSONParse
Hello,
Isn't that exactly what the example in the help file is doing?
I have never used Json command, but this example shows how to do what you are asking. Does it not?
Isn't that exactly what the example in the help file is doing?
Code: Select all
/*
MyJSON:
{ "uid" : "1234",
"clients" : ["client1","client2","client3"],
"people" : [{"Name":"Marcus","Age":"21"},{"Name":"Dorian","Age":"18"}],
"color" : "red",
"size" : 14 }
*/
LabelToVar>MyJSON,sJSON
JSONParse>sJSON,uid,result
JSONParse>sJSON,clients,result
JSONParse>sJSON,clients[1],result
JSONParse>sJSON,people[1].Name,result
Windows 7
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!
PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)
The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!