Open rwu2359 opened 6 years ago
Here's a test that demonstrates the error:
JSON.ArrayLength ( "[ 1, \"\", 3 ]" ; "" )
should give a result of 3, but instead gives 2.
The suggested fix by @rwu2359 would address this error.
I'm having trouble attaching files to the comment above, so I will try here: I've attached a copy of the JSONAdditions.fmp12 file that give an example of the error, and a copy that includes the fix. JSONAdditions-ArrayLength-empty-string-bug-example.fmp12.zip JSONAdditions-ArrayLength-empty-string-bug-FIXED.fmp12.zip
If the array contains values which are an empty string i.e. "" the function will not return the correct number of items in the array Suggest changing to
_values = JSONListKeys ( _array ; path )
This will return the correct number of full or empty slots in the array