JsonObjectDelInplace(json, int)

From NWN Lexicon
Jump to navigationJump to search
Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Deletes the element at sKey from jObject in-place (with no memory copies needed).

void JsonObjectDelInplace(
    json jArray,
    string sKey
);

Parameters

jArray
The json Array to modify.
sKey
The key of the element to delete.

Remarks

Will do nothing if jObject is not a object, or sKey does not exist on the object.

Version

This function was added in 88.8193.36-11 of NWN:EE.

Example

void main() 
{
    json jObject = JsonParse("{"CharName": "John", "CharLevel": "1"}");
	
    // Delete the "CharLevel" property from the json.
    JsonObjectDelInplace(jObject, "CharLevel");
    WriteTimestampedLogEntry(JsonDump(jObject)); // {"CharName": "John"}
}

See Also

functions:

JsonObjectDel JSON Functions