Remove
PowerScript function
Description
Removes a key. If more than one key with the same name exists, then
remove the first key. Notice that the IgnoreCase property (true by
default) determines whether the key name will be matched in a
case-sensitive manner.
Applies to
Syntax
|
1 |
objectname.remove ( Key ) |
|
Argument |
Description |
|---|---|
|
objectname |
Name of the JSONPackage object. |
|
Key |
A string specifying the key. |
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, the method returns null.
Examples
This example removes the “d_employess” key:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
boolean lb_exist 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) … lnv_package.Remove("d_employee") // lb_exist will return false lb_exist = lnv_package.ContainsKey("d_employee") |
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest