util.JSONArray.getLength

Returns the number of elements in the JSON array object.

Syntax

util.JSONArray.getLength()
  RETURNS INTEGER

Usage

The getLength() method returns the number of elements in the JSON array object.

This method can be used along with the get() and getType() method to read elements of a JSON array object.

Example

IMPORT util
MAIN
    DEFINE arr util.JSONArray
    DEFINE i INTEGER
    LET arr = util.JSONArray.parse('[123,8723,9232]')
    FOR i=1 TO arr.getLength()
        DISPLAY i, ": ", arr.get(i)
    END FOR
END MAIN