AddItemString
PowerScript function
Description
Adds the child item of JsonStringItem type.
Applies to
JSONGenerator objects
Syntax
|
1 |
objectname.AddItemString ( ParentItemHandle, Value ) |
|
1 |
objectname.AddItemString ( ParentItemHandle, Key, Value ) |
|
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 |
|
Value |
A string whose value is the value 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 item and then adds a string child
item:
|
1 2 3 4 5 6 |
JsonGenerator lnv_JsonGenerator Long ll_RootArray lnv_JsonGenerator = Create JsonGenerator ll_RootArray = lnv_JsonGenerator.CreateJsonArray() lnv_JsonGenerator.AddItemString(ll_RootArray, "string") |
Example 2
This example creates an object item and then adds a string child
item:
|
1 2 3 4 5 6 |
JsonGenerator lnv_JsonGenerator Long ll_RootObject lnv_JsonGenerator = Create JsonGenerator ll_RootObject = lnv_JsonGenerator.CreateJsonObject () lnv_JsonGenerator.AddItemString(ll_RootObject, "string", "value") |
See also