; JsonErrorPath Example ; --------------------- ; Requires Extended mode. q$=Chr(34) ; Double-quote character, for building JSON text ; A save-game corrupted deep inside a nested structure: ; the second inventory item is the bare word 'nope' src$="{"+q+"inventory"+q+":["+q+"sword"+q+",nope]}" Print "Parsing this broken save-game:" Print src Print "" save=ParseJson(src) Print "ParseJson returned "+save+" (0 = failed): "+JsonError() Print "" ; JsonErrorPath returns a $-rooted logical path to the failure, ; so you know WHICH value in a big document was bad Print "JsonErrorPath: "+JsonErrorPath() Print "" Print "$ is the document root, .inventory the property, [1] the element." Print "" Print "Press any key to close the example" WaitKey End