; JsonArraySet Example ; -------------------- ; Requires Extended mode. q$=Chr(34) ; Double-quote character, for building JSON text ; The hero's inventory before visiting the blacksmith inventory=ParseJson("["+q+"sword"+q+","+q+"shield"+q+","+q+"potion"+q+"]") Print "Before: "+JsonStringify(inventory,0) ; JsonArraySet copies the new value over an existing element - ; the rusty sword in slot 0 becomes a flame sword v=CreateJsonString("flame sword") JsonArraySet inventory,0,v FreeJson v Print "After: "+JsonStringify(inventory,0) Print "" Print "Slot 0 was replaced in place; slots 1 and 2 are untouched." FreeJson inventory Print "" Print "Press any key to close the example" WaitKey End