GetChildKey
PowerScript function
Description
Gets the key name of the child item in a JSON parser object.
Applies to
JSONParser objects
Syntax
|
1 |
objectname.GetChildKey ( ParentItemHandle, Index ) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the JSONParser object whose key name you |
|
ParentItemHandle |
A long whose value is the handle of the parent item |
|
Index |
A long whose value is the index of the child |
Return value
String.
Returns the key name of the child item if it succeeds and empty
string (“”) if an error occurs. If any argument’s value is null, the
method returns null.
Examples
This example gets the key of the child item:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
JsonParser lnv_JsonParser Long ll_RootObject, ll_id String ls_Json, ls_key, ls_name boolean lb_active lnv_JsonParser = Create JsonParser ls_Json = '{"id":1001, "name":"evan", "active":true}' // Loads a JSON string lnv_JsonParser.LoadString(ls_Json) ll_RootObject = lnv_JsonParser.GetRootItem() // Gets the key of the child item ls_key = lnv_JsonParser.GetChildKey(ll_RootObject, 1) ll_id = lnv_JsonParser.GetItemNumber(ll_RootObject, ls_key) ls_key = lnv_JsonParser.GetChildKey(ll_RootObject, 2) ls_name = lnv_JsonParser.GetItemString(ll_RootObject, ls_key) ls_key = lnv_JsonParser.GetChildKey(ll_RootObject, 3) lb_active = lnv_JsonParser.GetItemBoolean(ll_RootObject, ls_key) |
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest