Converts an array to a JSONArray and returns it.
Syntax
ArrayToJSONArray(Array)
Arguments
| Argument | Description |
|---|---|
| Array | Array to convert. Must use only a single dimension array. Can only contain numbers, Booleans, strings, JSONArrays, JSONObjects, and null. |
Return value
| Value | Description |
|---|---|
| Value | Converted JSONArray. |
Example
dim arrayVal(3)
arrayVal(1) = 1
arrayVal(2) = 2
arrayVal(3) = "three"
' Returns a JSONArray with 1, 2, "three" in it
jsonArray = ArrayToJSONArray(arrayVal)
strVal = jsonArray.ToString()
PrintLn("Should be \"[1, 2, \\\"three\\\"]\": " & strVal)