GetKey

Description

Gets the key name.

Applies to

JSONPackage

Syntax

objectname.GetKey ( Index )

Argument

Description

objectname

The name of the JSONPackage object whose key you want to obtain.

Index

A long value specifying the index of the key.


Return value

String.

Returns the key name if it succeeds and empty string ("") if an error occurs. If any argument's value is null, the method returns null.

Example

This example gets the number of keys first and then gets the name of each key.

long ll_index, ll_KeyCount
string ls_KeyName
datastore lds_employee
datawindowchild ldwc_active

JsonPackage lnv_package
lnv_package = create JsonPackage

...//Initialize data for lds_employee, ldwc_active

// package the data
lnv_package.SetValue("d_department", dw_department, false)
lnv_package.SetValue("d_employee", lds_employee) 
lnv_package.SetValue("dddw_active", ldwc_active, false)
ll_KeyCount = lnv_package.KeyCount()

for ll_index = 1 to ll_KeyCount
 ls_KeyName = lnv_package.GetKey(ll_index)
 …
next

See also

KeyCount