AddItemBlob
PowerScript function
Description
Adds a child item of JsonStringItem type in the JSON generator
object.
Applies to
Syntax
|
1 |
objectname.AddItemBlob ( ParentItemHandle, Value ) |
|
1 |
objectname.AddItemBlob ( ParentItemHandle, Key, Value ) |
|
1 |
objectname.AddItemBlob ( ParentItemPath, Value ) |
|
1 |
objectname.AddItemBlob ( ParentItemPath, Key, Value ) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the JSONGenerator object in which you want to |
|
ParentItemHandle |
A long whose value is the handle of the parent item of |
|
ParentItemPath |
A string whose value is the path of the parent item of |
|
Key |
A string whose value is the key of the child item |
|
Value |
A blob whose value is the value of the child item |
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 blob child item.
The result is [“dABoAGkAcwAgAGkAcwAgAGIAbABvAGIA”].
|
1 2 3 4 5 6 7 8 9 |
Long ll_RootArray JsonGenerator lnv_JsonGenerator lnv_JsonGenerator = Create JsonGenerator // Creates an array root item ll_RootArray = lnv_JsonGenerator.CreateJsonArray() // Adds a blob child item lnv_JsonGenerator.AddItemBlob(ll_RootArray, Blob("this is blob")) |
Example 2
This example creates an object root item and adds a blob child item.
The result is {“Blob”:”dABoAGkAcwAgAGkAcwAgAGIAbABvAGIA”}.
|
1 2 3 4 5 6 7 8 9 |
Long ll_RootObject JsonGenerator lnv_JsonGenerator lnv_JsonGenerator = Create JsonGenerator // Creates an object root item ll_RootObject = lnv_JsonGenerator.CreateJsonObject () // Adds a blob child item lnv_JsonGenerator.AddItemBlob(ll_RootObject, "blob", Blob("this is blob")) |
Example 3
This example creates an array root item and adds a blob child
item.
|
1 2 3 4 5 6 7 8 9 10 |
String ls_Path JsonGenerator lnv_JsonGenerator lnv_JsonGenerator = Create JsonGenerator // Creates an array root item lnv_JsonGenerator.CreateJsonArray() ls_Path = "/" // Adds a blob child item lnv_JsonGenerator.AddItemBlob(ls_Path, Blob("this is blob")) |
Example 4
This example creates an object root item and adds a blob child
item.
|
1 2 3 4 5 6 7 8 9 10 |
String ls_Path JsonGenerator lnv_JsonGenerator lnv_JsonGenerator = Create JsonGenerator // Creates an object root item lnv_JsonGenerator.CreateJsonObject () ls_Path = "/" // Adds a blob child item lnv_JsonGenerator.AddItemBlob(ls_Path, "blob", Blob("this is blob")) |
See also