AddItemNull
PowerScript function
Description
Adds the child item of JsonNullItem type in the JSON generator
object.
Applies to
JSONGenerator objects
Syntax
|
1 |
objectname.AddItemNull ( ParentItemHandle ) |
|
1 |
objectname.AddItemNull ( ParentItemHandle, Key ) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the JSONGenerator object in which you |
|
ParentItemHandle |
A long whose value is the handle of the parent item |
|
Key |
A string whose value is the key of the child |
Return value
Long.
Returns the handle of the new child item if it succeeds and -1 if an
error occurs. If any argument’s value is null, the method returns
null.
Example 1
This example creates an array root item and adds a null child item.
The result is [null].
|
1 2 3 4 5 6 7 8 9 |
Long ll_RootArray JsonGenerator lnv_JsonGenerator lnv_JsonGenerator = Create JsonGenerator // Create an array root item ll_RootArray = lnv_JsonGenerator.CreateJsonArray() // Add a null child item lnv_JsonGenerator.AddItemNull(ll_RootArray) |
Example 2
This example creates an object root item and adds a null child item.
The result is {“null”:null}.
|
1 2 3 4 5 6 7 8 9 |
Long ll_RootObject JsonGenerator lnv_JsonGenerator lnv_JsonGenerator = Create JsonGenerator // Create an object root item ll_RootObject = lnv_JsonGenerator.CreateJsonObject () // Add a null child item lnv_JsonGenerator.AddItemNull(ll_RootObject, "null") |
See also