Note that there are some explanatory texts on larger screens.

plurals
  1. POJsonObject.GetNamedObject() order
    primarykey
    data
    text
    <p>I'm trying to read out JSON using the using <code>Windows.Data.Json</code>. But for some reason GetNamedObject() returns my objects in a very silly way..</p> <p>This is my JSON: </p> <pre><code>{ "schedule":{ "schedule":{ "Monday":{ "1":{ "class":"oo5", "classroom":"K53" }, "2":{ "class":"oo5", "classroom":"K53" } }, "Tuesday":{ "2":{ "class":"biol6", "classroom":"S12" }, "8":{ "class":"loC", "classroom":"126" }, "9":{ "class":"loC", "classroom":"126" } }, "Wednesday":{ "3":{ "class":"entlC", "classroom":"K51" } }, "Thursday":{ "3":{ "class":"wisb3", "classroom":"S29" }, "8":{ "class":"inf8", "classroom":"S22" } }, "Friday":{ "1":{ "name":"dhr. F. Lange de", "class":"schk1", "classroom":"S09" } "7":{ "name":"mw. O. Beek ter", "class":"nat2", "classroom":"S10" } } } } } </code></pre> <p>Note: this is a shortened version.</p> <p>I'm trying to read out the days in the given order: "Monday, Tuesday, Wednesday, Thursday, Friday". </p> <p>I'm using the following C# code:</p> <pre><code>JsonObject JSON_OBJ_root; JsonObject.TryParse(return_json, out JSON_OBJ_root); JsonObject JSON_OBJ_schedule = JSON_OBJ_root.GetNamedObject("schedule"); JsonObject JSON_OBJ_days = JSON_OBJ_schedule.GetNamedObject("schedule"); //I think this is the problem </code></pre> <p>And when I use the debugger and lookup <code>JSON_OBJ_days</code>:</p> <p><a href="http://i.stack.imgur.com/WX5I5.png" rel="nofollow">http://i.stack.imgur.com/WX5I5.png</a></p> <p>Translation:</p> <pre><code>Woensdag = Wednesday Vrijdag = Friday Donderdag = Thursday Dinsdag = Tuesday Maandag = Monday </code></pre> <p>So, for some reason GetNamedObject() returns its objects in a random order. This is just brain bending! Can anyone tell me why this is and how I could solve this problem? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload