Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Queries entries from JSON array.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
JSON | 10.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
json | A JSON text or reference. | "[1,2,3]" |
Returns list or error.
Loop over JSON array items:
# get some huge JSON array
Set Variable [ $json ; Value: "[\"Hello\", \"World\"]" ]
# Create list of JSON reference numbers
Set Variable [ $list ; Value: MBS( "JSON.GetArrayItems"; $json ) ]
If [ MBS("IsError") = 0 ]
# loop over list
Set Variable [ $count ; Value: ValueCount($list) ]
If [ $count > 0 ]
Set Variable [ $index ; Value: 1 ]
If [ $index ≤ $count ]
Loop
# your script steps here
Set Variable [ $j ; Value: GetValue($list; $index) ]
Show Custom Dialog [ "JSON item" ; MBS("JSON.Format"; $j) ]
#
# next
Set Variable [ $index ; Value: $index + 1 ]
Exit Loop If [ $index > $count ]
End Loop
End If
End If
# free them all
Set Variable [ $r ; Value: MBS("JSON.Release"; $list) ]
End If
This function checks for a license.
Created 22nd August 2020, last changed 22nd August 2020