Previous Next

Set( ) method (JsonObject)
Sets the named property of JsonObject to the given value. On successful execution, the method returns TRUE.
Return type:
Access:
Applies to:
 
Syntax 
Set( INPUT property-name AS CHARACTER,
INPUT value AS CHARACTER )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS COM-HANDLE )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS DATE )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS DATETIME )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS DATETIME-TZ )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS DECIMAL )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS HANDLE )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS INT64 )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS INTEGER )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS LOGICAL )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS LONGCHAR )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS MEMPTR )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS RAW )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS RECID )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS ROWID )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS CLASS JsonObject )
 
Set( INPUT property-name AS CHARACTER,
     INPUT value AS CLASS JsonArray )
property-name
A CHARACTER expression that indicates the name of the existing property whose value is to be changed.
A JsonError is raised if:
*
property-name is the empty string (""), or is the Unkown value (?)
*
value
Indicates the new value to which the property is to be set. The data type of the property is defined by the data type mapping described below. If value is the Unknown value (?) the property is set to a JSON null value.
The data type of the JSON value set by this method call depends upon the ABL data type of the value parameter.
Table 141:
Setting a property to an ABL value that maps to a different JSON data type than the current data type changes the elements’s data type. For example:
 
lSuccess = myObj:Add(“myProp”, “Hello World”).
lSuccess = myObj:Set(“myProp”, TRUE).
iType = myObj:GetType(“myProp”).
In the above example, iType is set to Progress.Json.ObjectModel.JsonDataType:BOOLEAN. (See Progress.Json.ObjectModel.JsonDataType class.)
If you set the property to a JsonObject or JsonArray that references this JsonObject or a JSON construct further up the JSON construct tree, a JsonError is raised.

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.