PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.

Prev | Next | Users Guide | PhantomScript Reference | P1 Systems


Networking

JSONAddNull

Syntax

JSONAddNull <json-var> <member-name>

Description

Add a null value to a JSON object.

Parameters

<json-var>

A variable containing the JSON object to which the null value is to be added.

<member-name>

The name of the member in the JSON object that is to contain the null value.

Remarks

JSON (JavaScript Object Notation) is a lightweight data format based on the object notation of the JavaScript language. It does not require JavaScript to read or write; it is easy to parse by any language and libraries and tools exist in many languages to handle JSON.

Here is the entire list of PhantomScript JSON statements: ListAsJSONArray, JSONAddArray, JSONAddBoolean, JSONAddNull, JSONAddNumber, JSONAddObject, JSONAddString, JSONArrayAsList, JSONGetKeys, JSONGetType, JSONGetValue, JSONDelete.

Example

Local jsonObj1 

JSONAddNumber jsonObj1 "a-number" 42
JSONAddNull jsonObj1 "nothing"
JSONAddNull jsonObj1 "nothing-else"

MessageBox Text=jsonObj1

The above script fragment displays this JSON object in the message box:

{ "a-number": 42, "nothing": null, "nothing-else": null }
.


Prev | Next | Users Guide | PhantomScript Reference | P1 Systems

PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.