json parse/Eachin sort order info
Monkey Forums/Monkey Programming/json parse/Eachin sort order info
| ||
Just for other people that working with json files. The parse order is not the same as the file. { "w":2048, "h":768, "p":200, "data":{ "world":{ "z":1, "atlas":"atlas-scene1.json" }, "player":{ "z":2, "atlas":"atlas-lopen.json", "initFrameKey":"looprechts", "initX":800, "initY":712 } } } Local jso:JsonObject = New JsonObject(str) For Local it:map.Node<String, JsonValue> = Eachin JsonObject( jso.Get("data") ).GetData() Print it.Key Next Output: player world |
| ||
Thats the functionality of Stringmaps..: Output: abc hehe world zabc |
| ||
If you want them in order, then you need an JsonArray using [], not an JsonObject {}. Or, you access things by name if using a JsonObject []. |