; JsonArrayClear Example ; ---------------------- ; Requires Extended mode. q$=Chr(34) ; Double-quote character, for building JSON text ; The hero's inventory, moments before a cursed chest empties it inventory=ParseJson("["+q+"sword"+q+","+q+"shield"+q+","+q+"potion"+q+"]") Print "Before the curse: "+JsonStringify(inventory,0) Print "Item count: "+JsonCount(inventory) Print "" ; JsonArrayClear removes every element but keeps the array itself JsonArrayClear inventory Print "After the curse: "+JsonStringify(inventory,0) Print "Item count: "+JsonCount(inventory) Print "" Print "The array handle is still valid - ready to collect new loot." FreeJson inventory Print "" Print "Press any key to close the example" WaitKey End