Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

srp_json - getmembers

Is there a way to retrieve the member names in the order in which they appear in the json?
GetMembers returns a sorted list, which is good if you just want to know what's there. In my current scenario, I want to present them to the user in the order in which they are saved as they actually represent a workflow.

Any suggestions?

Comments

  • Mark - Yeah...I wanted that myself once but was told...er convinced...that this is just not possible. The nature of JSON member objects is that they are not inherently sorted regardless of the order you add and view them in the original JSON. Rather, they are keyed. If you need a sorted list you must use an array.
  • Bugger! I was hoping to be more generic so the content could change and my code wouldn't have to.

    Oh well, it's read only stuff for now so I'll start generically and see where it takes me.
  • From www.json.org.
    An object is an unordered set of name/value pairs.
  • Damn you Kevin and your factual references!

    I think I'm going t have to take the long way round.
Sign In or Register to comment.