Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Adds a number to an array.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
JSON 4.3 Yes Yes Yes Yes Yes
MBS( "JSON.AddNumberToArray"; json; value )   More


Parameter Description Example value
json A JSON text or reference. [1,2,3]
value The number to be added 5


Returns JSON code or error.


Adds a number to an array.
Same as JSON.AddItemToArray, but calls JSON.CreateNumber automatically for you.

With version 6, you can pass several parameters to add several entries to the array.
When adding to a JSON reference, the function returns that reference number.


Adds an item to array:

MBS( "JSON.AddItemToArray"; "[1,2,3]"; 4)

Example result: [1, 2, 3, 4]

Add 4 numbers to an array:

MBS( "JSON.AddNumberToArray"; "[]"; 1; 2; 3; 4 )

Example result: [1, 2, 3, 4]

Add big number:

MBS( "JSON.AddNumberToArray"; "[]"; 12063660878882855000013426248015578834577 )

Example result: [12063660878882855000013426248015578834577]

See also

Blog Entries

Created 26th August 2014, last changed 11st May 2018

JSON.AddNullToObject   -   JSON.AddNumberToObject

Feedback: Report problem or ask question.

MBS Xojo blog