Jump to content

Peeve: Nested calls


Love Zhaoying
 Share

You are about to reply to a thread that has been inactive for 622 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Peeve: I finally figured out how to store a JSON Object in a JSON Array.

string sKey;     // Key for a JSON object - We will look for this later when iterating the JSON array

string sObject; // This is an existing JSON object we want to add. It contains something like "{Key1:Value1, Key2:Value2, ..}"

string sArray; // A JSON array - we are adding the JSON object to it

sArray = llJsonSetValue(sArray, [JSON_APPEND], llJsonSetValue("", [sKey], sObject) );

My mind wasn't built for nested calls.

Of course, the same could be done like this:

string sTemp =  llJsonSetValue("", [sKey], sObject); // Make a new JSON obect: "{sKey: {sObject} }"

sArray = llJsonSetValue(sArray, [JSON_APPEND], sTemp);  // Skip the nest

Whaddya expect, I'm a lion, not a bird. I live in a cave, not a nest!

 

Edited by Love Zhaoying
  • Haha 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 622 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...