AutoIt
AutoIt
Example: JsonObject.NewArrayOf method
See more JSON Examples
Demonstrates theNewArrayOf method.
Chilkat AutoIt Downloads
Local $bSuccess = False
Local $sBig_cats = "[""lion"",""tiger"",""leopard"",""jaguar"",""cheetah"",""snow leopard"",""clouded leopard"",""cougar"",""puma"",""panther""]"
$oJson = ObjCreate("Chilkat.JsonObject")
$oJson.UpdateString("test","abc")
$bSuccess = $oJson.NewArrayOf("big_cats",$sBig_cats)
If ($bSuccess = False) Then
ConsoleWrite($oJson.LastErrorText & @CRLF)
Exit
EndIf
$oJson.EmitCompact = False
ConsoleWrite($oJson.Emit() & @CRLF)
; Result:
; {
; "test": "abc",
; "big_cats": [
; "lion",
; "tiger",
; "leopard",
; "jaguar",
; "cheetah",
; "snow leopard",
; "clouded leopard",
; "cougar",
; "puma",
; "panther"
; ]
; }