; JsonError Example ; ----------------- ; Requires Extended mode. q$=Chr(34) ; Double-quote character, for building JSON text ; A save-game file that was corrupted: 12x5 is not a number line1$="{" line2$=q+"player"+q+": "+q+"Aria"+q+"," line3$=q+"gold"+q+": 12x5" line4$="}" src$=line1+Chr(10)+line2+Chr(10)+line3+Chr(10)+line4 Print "Parsing this broken save-game:" Print src Print "" ; The parse fails, returning zero and setting the diagnostics save=ParseJson(src) Print "ParseJson returned "+save+" (0 = failed)" Print "" ; JsonError returns a human-readable description of what went wrong Print "JsonError: "+JsonError() Print "(at line "+JsonErrorLine()+", column "+JsonErrorColumn()+")" Print "" Print "Press any key to close the example" WaitKey End