Creates one or more new elements, setting each element's value to a JSON number value represented by the CHARACTER parameter and adds it to the JsonArray.
This method is useful in situations where none of the ABL numeric data types is used to hold a numeric value. For example, 10E+100.
On successful execution, this method returns the index of the newly added element. If the value is an ABL array, the index of the last element added is returned.
Return type: INTEGER
Access: PUBLIC
Applies to: Progress.Json.ObjectModel.JsonArray class
AddNumber( INPUT value AS CHARACTER ) AddNumber( INPUT array-value AS CHARACTER EXTENT ) AddNumber( INPUT index AS INTEGER, INPUT value AS CHARACTER ) AddNumber( INPUT index AS INTEGER, INPUT array-value AS CHARACTER EXTENT ) |
When this method is called with one parameter, the new elements are added to the end of the JsonArray. When this method is called with two parameters, the AVM inserts the new elements after the element at the specified index.
If the overloading with an ABL array parameter is used, the AVM uses each element of the ABL array to initialize a new element of the JsonArray.
If the value is not a valid JSON number value or is an empty string (""), a JsonError is raised.
A JsonError is raised if:
If index is 0, the new element is inserted at the beginning of the array making that new elements index 1.
If index is the Unknown value (?), less than 0, or is larger than the length of the array, a JsonError is raised.