Creates a property with a given name and value. On successful execution, this method returns TRUE.
Return type: LOGICAL
Access: PUBLIC
Applies to: Progress.Json.ObjectModel.JsonObject class
Add( INPUT property-name AS CHARACTER, INPUT value AS CHARACTER ) Add( INPUT property-name AS CHARACTER, INPUT value AS COM-HANDLE ) Add( INPUT property-name AS CHARACTER, INPUT value AS DATE ) Add( INPUT property-name AS CHARACTER, INPUT value AS DATETIME ) Add( INPUT property-name AS CHARACTER, INPUT value AS DATETIME-TZ ) Add( INPUT property-name AS CHARACTER, INPUT value AS DECIMAL ) Add( INPUT property-name AS CHARACTER, INPUT value AS HANDLE ) Add( INPUT property-name AS CHARACTER, INPUT value AS INT64 ) Add( INPUT property-name AS CHARACTER, INPUT value AS INTEGER ) Add( INPUT property-name AS CHARACTER, INPUT value AS LOGICAL ) Add( INPUT property-name AS CHARACTER, INPUT value AS LONGCHAR ) Add( INPUT property-name AS CHARACTER, INPUT value AS MEMPTR ) Add( INPUT property-name AS CHARACTER, INPUT value AS RAW ) Add( INPUT property-name AS CHARACTER, INPUT value AS RECID ) Add( INPUT property-name AS CHARACTER, INPUT value AS ROWID ) Add( INPUT property-name AS CHARACTER, INPUT value AS CLASS JsonObject ) Add( INPUT property-name AS CHARACTER, INPUT value AS CLASS JsonArray ) |
If a property by this name already exists in this JsonObject or if this parameter is an empty string ("") or is the Unknown value (?), a JsonError is raised.
If you add a JsonObject or JsonArray that references this JsonObject or a construct further up the JSON construct tree, a JsonError is raised.
The data type of the added JSON value set by this method call depends upon the ABL data type of the 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 value |
DATE, DATETIME, DATETIME-TZ | string with a value as if you had called ISO-DATE( ) on value |
COM-HANDLE, HANDLE, RECID | number with a value as if you had called INTEGER( ) on value |