GetPathByItem

Description

Gets the path of the item.

Applies to

JSONGenerator objects

Syntax

objectname.GetPathByItem ( ItemHandle )

Argument

Description

objectname

The name of the JSONGenerator object whose path you want to obtain.

ItemHandle

A long specifying the handle of the item.


Return value

String.

Returns the item path if it succeeds. If any argument's value is null, the method returns null. If an error occurs, the method returns the exception.

Examples

This example determines the item path according to the item handle and then adds three child items:

Long ll_Object
String ls_RootPath,ls_ObjectPath
JsonGenerator lnv_JsonGenerator
lnv_JsonGenerator = Create JsonGenerator

// Creates an object root item
lnv_JsonGenerator.CreateJsonObject ()

// Adds an object child item
ls_RootPath = "/"
ll_Object = lnv_JsonGenerator.AddItemObject(ls_RootPath, "object")
ls_ObjectPath = lnv_JsonGenerator.GetPathByItem(ll_Object)

lnv_JsonGenerator.AddItemNumber(ls_ObjectPath, "year", 2017)
lnv_JsonGenerator.AddItemDate(ls_ObjectPath, "date", 2017-09-21)
lnv_JsonGenerator.AddItemTime(ls_ObjectPath, "time", 12:00:00)

See also

GetItemByPath