Retrieves the number of elements in a JSON array. Number of elements := last index + 1
Json.bdh
JsonGetArrayLength( in handle : number ): number;
Parameter | Description |
---|---|
handle | Valid handle to a JSON array |
The number of elements in the JSON array.
transaction TMain var jsonArray : number; arrayLength : number; begin jsonArray := JsonParse("[0,1,2,3,4]"); arrayLength := JsonGetArrayLength(jsonArray); Print("Length: " + string(arrayLength)); JsonFree(jsonArray); end TMain;
Length: 5