; JsonArrayAppend Example ; ----------------------- ; Requires Extended mode. ; The hero's inventory grows as loot is picked up inventory=CreateJsonArray() Print "Empty inventory: "+JsonStringify(inventory,0) ; JsonArrayAppend copies the value onto the end of the array, ; so the temporary handle is freed straight afterwards v=CreateJsonString("sword") JsonArrayAppend inventory,v FreeJson v Print "Picked up a sword: "+JsonStringify(inventory,0) v=CreateJsonString("shield") JsonArrayAppend inventory,v FreeJson v Print "Picked up a shield: "+JsonStringify(inventory,0) v=CreateJsonString("potion") JsonArrayAppend inventory,v FreeJson v Print "Picked up a potion: "+JsonStringify(inventory,0) Print "" Print "Final item count: "+JsonCount(inventory) FreeJson inventory Print "" Print "Press any key to close the example" WaitKey End