Ola
I'm writing a problem solving app and need to sort a list of key value pairs in descending order, for example, this is a result of my coding..
How do I make this to have the items with 3 at the top?
Thanks
I'm writing a problem solving app and need to sort a list of key value pairs in descending order, for example, this is a result of my coding..
B4X:
Dim boQuery As BANanoJSONQuery
boQuery.Initialize(boQueryList)
'sort by value desc
Dim boQSortDesc As BANanoJSONQuery = boQuery.Order("{'value':'desc'}")
Dim SDList As List = boQSortDesc.All
'let' see output
Log(SDList)
B4X:
0: {id: "a", value: 3}
1: {id: "b", value: 3}
2: {id: "c", value: 0}
3: {id: "d", value: 3}
4: {id: "e", value: 3}
5: {id: "f", value: 0}
6: {id: "g", value: 0}
7: {id: "h", value: 0}
8: {id: "i", value: 0}
9: {id: "j", value: 0}
10: {id: "k", value: 0}
11: {id: "l", value: 0}
12: {id: "m", value: 0}
13: {id: "o", value: 0}
14: {id: "p", value: 0}
15: {id: "q", value: 0}
16: {id: "r", value: 0}
17: {id: "s", value: 0}
18: {id: "t", value: 0}
19: {id: "u", value: 0}
20: {id: "v", value: 0}
21: {id: "w", value: 0}
22: {id: "x", value: 0}
23: {id: "y", value: 0}
How do I make this to have the items with 3 at the top?
Thanks