Set( ) method (JsonArray)
- Last Updated: January 18, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Sets an element of the JsonArray to the specified value. On successful completion, the method returns TRUE.
Return type: LOGICAL
Access: PUBLIC
Applies to: Progress.Json.ObjectModel.JsonArray class
Syntax
|
- index
- An INTEGER value that indicates the element in the array to
be changed. Indexing into JsonArray is 1-based.
A JsonError is raised if index is less than 1, is greater than the length of the JsonArray, or is the Unknown value (
?). - value
- Indicates the value to which the existing element is to be set.
The data type of the element is defined by the data type mapping.
If value is the Unknown value (
?), the element is set to the 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 1. Value parameter A value parameter of data type Data type of JSON value CHARACTER, LONGCHAR
string INTEGER, INT64, DECIMAL number LOGICAL boolean MEMPTR, RAW, ROWID string with a value as if you had called BASE64-ENCODE( )on valueDATE, DATETIME, DATETIME-TZ string with a value as if you had called ISO-DATE( )on valueCOM-HANDLE, HANDLE, RECID number with a value as if you had called INTEGER( )on value
Setting an element to an ABL value that maps to a different
JSON data type than the current data type changes the elements's
data type. The following code sample sets iType to
JsonDataType:BOOLEAN:
|