util.JSONArray.getLength

Returns the number of elements in the JSON array object.

Syntax

util.JSONArray.getLength()
  RETURNING length INTEGER

Usage

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

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

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