util.JSONArray.getLength() returns the number of the members included in the specified JSON array.
Syntax
CALL util.JSONArray.getLength()
Usage and examples
util.JSONArray.get() is used to return or display how many members there are in the specified JSON array.
MAIN
DEFINE json_arr util.JSONArray
LET json_arr=util.JSONArray.parse('[123, "abc", null]'()
DISPLAY json_arr.getLength()
CALL fgl_getkey()
END MAIN
MAIN
DEFINE da DYNAMIC ARRAY OF INTEGER
DEFINE json_arr util.JSONArray
LET da[1] =1
LET da[2] =12
LET da[3] =123
LET da[4] =1234
LET da[5] =12345
LET json_arr=util.JSONArray.fromFGL(da)
DISPLAY json_arr.getLength()
CALL fgl_getkey()
END MAIN
This method can be used together with util.JSONArray.getType() in order to read the members of JSON arrays: